From e7e8b64dd1004fa9d166734c937de2178b79b0b6 Mon Sep 17 00:00:00 2001 From: "Ann + J.M" Date: Thu, 17 Apr 2014 08:50:12 +0200 Subject: [PATCH 1/2] HTML5 data attributes for favorite table links Signed-off-by: Ann + J.M --- js/navigation.js | 6 +++--- libraries/RecentFavoriteTable.class.php | 2 +- libraries/structure.lib.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index 8f817b7e62..ad548d4ac3 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -240,10 +240,10 @@ $(function () { event.preventDefault(); $self = $(this); var anchor_id = $self.attr("id"); - if($self.attr('favtargetn') != null) - if($('a[favtargets="' + $self.attr('favtargetn') + '"]').length > 0) + if($self.data("favtargetn") != null) + if($('a[data-favtargets="' + $self.data("favtargetn") + '"]').length > 0) { - $('a[favtargets="' + $self.attr('favtargetn') + '"]').trigger('click'); + $('a[data-favtargets="' + $self.data("favtargetn") + '"]').trigger('click'); return; } diff --git a/libraries/RecentFavoriteTable.class.php b/libraries/RecentFavoriteTable.class.php index 776ac089ef..3b26c7a44b 100644 --- a/libraries/RecentFavoriteTable.class.php +++ b/libraries/RecentFavoriteTable.class.php @@ -215,7 +215,7 @@ class PMA_RecentFavoriteTable . PMA_URL_getCommon($fav_params); $html .= 'href="' . $fav_rm_url . '" title="' . __("Remove from Favorites") - . '" favtargetn="' . $table['db'] . "." . $table['table'] + . '" data-favtargetn="' . $table['db'] . "." . $table['table'] . '" >' . PMA_Util::getIcon('b_favorite.png') . ''; diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 0c83b4a9a5..e3409aeeeb 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2727,7 +2727,7 @@ function PMA_getHtmlForFavoriteAnchor($db, $current_table, $titles) $html_output .= 'href="' . $fav_url . '" title="' . ($already_favorite ? __("Remove from Favorites") : __("Add to Favorites")) - . '" favtargets="' . $db . "." . $current_table['TABLE_NAME'] + . '" data-favtargets="' . $db . "." . $current_table['TABLE_NAME'] . '" >' . (!$already_favorite ? $titles['NoFavorite'] : $titles['Favorite']) . ''; From 63e40958646c88d46a6d5b283c1daac74ec21008 Mon Sep 17 00:00:00 2001 From: "Ann + J.M" Date: Thu, 17 Apr 2014 09:01:53 +0200 Subject: [PATCH 2/2] display: block for recent/favorite table list Signed-off-by: Ann + J.M --- themes/original/css/navigation.css.php | 15 ++++++++++++--- themes/pmahomme/css/navigation.css.php | 17 +++++++++++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/themes/original/css/navigation.css.php b/themes/original/css/navigation.css.php index 1c92c166ae..ed6a8a106f 100644 --- a/themes/original/css/navigation.css.php +++ b/themes/original/css/navigation.css.php @@ -345,15 +345,24 @@ li.fast_filter.db_fast_filter { display: none; z-index: 802; } -#pma_quick_warp .drop_list:hover ul{ +#pma_quick_warp .drop_list:hover ul { display: block; } #pma_quick_warp .drop_list li { - padding: 2px .3em; + white-space: nowrap; } #pma_quick_warp .drop_list li img { vertical-align: sub; } #pma_quick_warp .drop_list li:hover { background: #f2f2f2; -} \ No newline at end of file +} +#pma_quick_warp .drop_list a { + display: block; + padding: .1em .3em; +} +#pma_quick_warp .drop_list a.favorite_table_anchor { + clear: left; + float: left; + padding: .1em .3em 0; +} diff --git a/themes/pmahomme/css/navigation.css.php b/themes/pmahomme/css/navigation.css.php index 61770da8bd..7a0e213cb6 100644 --- a/themes/pmahomme/css/navigation.css.php +++ b/themes/pmahomme/css/navigation.css.php @@ -318,7 +318,7 @@ li.fast_filter.db_fast_filter { margin-: 3px; padding: 2px 0; } -#pma_quick_warp .drop_button{ +#pma_quick_warp .drop_button { padding: 0 .3em; border: 1px solid #ddd; border-radius: .3em; @@ -347,15 +347,24 @@ li.fast_filter.db_fast_filter { display: none; z-index: 802; } -#pma_quick_warp .drop_list:hover ul{ +#pma_quick_warp .drop_list:hover ul { display: block; } #pma_quick_warp .drop_list li { - padding: 2px .3em; + white-space: nowrap; } #pma_quick_warp .drop_list li img { vertical-align: sub; } #pma_quick_warp .drop_list li:hover { background: #f2f2f2; -} \ No newline at end of file +} +#pma_quick_warp .drop_list a { + display: block; + padding: .2em .3em; +} +#pma_quick_warp .drop_list a.favorite_table_anchor { + clear: left; + float: left; + padding: .1em .3em 0; +}