diff --git a/js/functions.js b/js/functions.js index 4f425b314339..cbfe0e38ab7d 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1829,4 +1829,28 @@ $(document).ready(function() { disable_popup(); } }); + + /** + * Hides certain table structure actions, replacing them with the word "More". They are displayed + * in a dropdown menu when the user hovers over the word "More." + */ + // Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers) + $("table[id='tablestructure'] td[class='browse']").remove(); + $("table[id='tablestructure'] td[class='primary']").remove(); + $("table[id='tablestructure'] td[class='unique']").remove(); + $("table[id='tablestructure'] td[class='index']").remove(); + $("table[id='tablestructure'] td[class='fulltext']").remove(); + + // Display the "more" text + $("table[id='tablestructure'] td[class='more_opts']").show() + + // When "more" is hovered over, show the hidden actions + $("table[id='tablestructure'] td[class='more_opts']").hover( + function() { + $(this).children(".structure_actions_dropdown").show(); + }, + function() { + $(this).children(".structure_actions_dropdown").hide(); + } + ); }); \ No newline at end of file diff --git a/tbl_structure.php b/tbl_structure.php index 8f1f26db9abd..cfbd961adde6 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -160,6 +160,18 @@ $titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), true); $titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true); +// hidden action titles (image and string) +$hidden_titles = array(); +$hidden_titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true, true); +$hidden_titles['Primary'] = PMA_getIcon('b_primary.png', __('Primary'), true, true); +$hidden_titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Primary'), true, true); +$hidden_titles['Index'] = PMA_getIcon('b_index.png', __('Index'), true, true); +$hidden_titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Index'), true, true); +$hidden_titles['Unique'] = PMA_getIcon('b_unique.png', __('Unique'), true, true); +$hidden_titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), true, true); +$hidden_titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Fulltext'), true, true); +$hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), true, true); + /** * Displays the table structure ('show table' works correct since 3.23.03) */ @@ -361,59 +373,63 @@ echo '' . _pgettext('None for default','None') . ''; } ?>