diff --git a/js/navigation.js b/js/navigation.js index dfecbad8fa..063b7d2b9b 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -72,6 +72,36 @@ $(function () { }); }); + /** + * Register event handler to toggle + * the 'link with main panel' icon on mouseenter. + */ + $(document).on('mouseenter', '#pma_navigation_sync', function (event) { + event.preventDefault(); + var synced = $('#pma_navigation_tree').hasClass('synced'); + var $img = $('#pma_navigation_sync').children('img'); + if (synced) { + $img.removeClass('ic_s_link').addClass('ic_s_unlink'); + } else { + $img.removeClass('ic_s_unlink').addClass('ic_s_link'); + } + }); + + /** + * Register event handler to toggle + * the 'link with main panel' icon on mouseout. + */ + $(document).on('mouseout', '#pma_navigation_sync', function (event) { + event.preventDefault(); + var synced = $('#pma_navigation_tree').hasClass('synced'); + var $img = $('#pma_navigation_sync').children('img'); + if (synced) { + $img.removeClass('ic_s_unlink').addClass('ic_s_link'); + } else { + $img.removeClass('ic_s_link').addClass('ic_s_unlink'); + } + }); + /** * Register event handler to toggle * the linking with main panel behavior diff --git a/libraries/navigation/NavigationTree.class.php b/libraries/navigation/NavigationTree.class.php index 457cec4a10..4ee33fac29 100644 --- a/libraries/navigation/NavigationTree.class.php +++ b/libraries/navigation/NavigationTree.class.php @@ -1132,11 +1132,11 @@ class PMA_NavigationTree 's_collapseall.png', 'pma_navigation_collapse' ); - $syncImage = 's_link.png'; + $syncImage = 's_unlink.png'; $title = __('Link with main panel'); if ($GLOBALS['cfg']['NavigationLinkWithMainPanel']) { - $syncImage = 's_unlink.png'; - $title = __('Unlink from main panel'); + $syncImage = 's_link.png'; + $title = __('Unlink with main panel'); } $retval .= PMA_Util::getNavigationLink( '#',