Merge branch 'colresize' into aris

This commit is contained in:
Aris Feryanto 2011-06-14 09:44:05 +07:00
commit ff292800be
2 changed files with 26 additions and 16 deletions

View File

@ -13,8 +13,10 @@
hintShown: false, // true if hint balloon is shown, used by updateHint() method
reorderHint: '', // string, hint for column reordering
sortHint: '', // string, hint for column sorting
markHint: '', // string, hint for column marking
showReorderHint: false, // boolean, used by showHint() method
showSortHint: false, // boolean, used by showHint() method
showMarkHint: false,
hintIsHiding: false, // true when hint is still shown, but hide() already called
// functions
@ -45,7 +47,7 @@
width: $(obj).width()
});
$(this.cPointer).css({
top: objPos.top,
top: objPos.top
});
} else { // vertical alignment
$(this.cCpy).css({
@ -55,7 +57,7 @@
width: $(obj).width()
});
$(this.cPointer).css({
top: objPos.top,
top: objPos.top
});
}
@ -349,9 +351,13 @@
text += this.reorderHint;
}
if (this.showSortHint) {
text += this.showReorderHint ? '<br />' : '';
text += text.length > 0 ? '<br />' : '';
text += this.sortHint;
}
if (this.showMarkHint) {
text += text.length > 0 ? '<br />' : '';
text += this.markHint;
}
// hide the hint if no text
if (!text) {
@ -448,6 +454,7 @@
// assign column reorder & column sort hint
g.reorderHint = $('#col_order_hint').val();
g.sortHint = $('#sort_hint').val();
g.markHint = $('#col_mark_hint').val();
// determine whether to show the column reordering hint or not
g.showReorderHint = $firstRowCols.length > 1;
@ -488,22 +495,25 @@
$(t).find('th.draggable')
.mousedown(function(e) {
g.dragStartMove(e, this);
})
// show/hide draggable column
.mouseenter(function(e) {
g.showHint(e);
})
.mouseleave(function(e) {
g.hideHint();
});
}
$(t).find('th.draggable')
.mouseenter(function(e) {
g.showMarkHint = !g.showSortHint;
g.showHint(e);
})
.mouseleave(function(e) {
g.hideHint();
});
$(t).find('th.draggable a')
.mouseenter(function(e) {
g.showSortHint = true;
g.showMarkHint = false;
g.showHint(e);
})
.mouseleave(function(e) {
g.showSortHint = false;
g.showMarkHint = true;
g.showHint(e);
});
$(document).mousemove(function(e) {

View File

@ -192,11 +192,11 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
function PMA_isBrowsing()
{
// global variables set from sql.php
global $is_count, $is_export, $is_func, $is_analyze;
global $is_count, $is_export, $is_func, $is_analyse;
global $analyzed_sql;
return basename($GLOBALS['PMA_PHP_SELF']) == 'sql.php'
&& ! ($is_count || $is_export || $is_func || $is_analyse)
return ! ($is_count || $is_export || $is_func || $is_analyse)
&& count($analyzed_sql[0]['select_expr']) == 0
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& count($analyzed_sql[0]['table_ref']) == 1;
}
@ -406,10 +406,10 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di
echo '<input id="table_create_time" type="hidden" value="' .
PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], 'CREATE_TIME') . '" />';
}
// generate text for draggable column hint
// generate hints
echo '<input id="col_order_hint" type="hidden" value="' . __('Drag to reorder') . '" />';
// generate text for sortable column hint
echo '<input id="sort_hint" type="hidden" value="' . __('Click to sort') . '" />';
echo '<input id="col_mark_hint" type="hidden" value="' . __('Click to mark/unmark') . '" />';
?>
</td>
</tr>