diff --git a/module/api/js/view.ui.js b/module/api/js/view.ui.js index e6f7888334..8ecb1527a7 100644 --- a/module/api/js/view.ui.js +++ b/module/api/js/view.ui.js @@ -78,21 +78,7 @@ $(function() if($.cookie.get('isFullScreen') == 1) fullScreen(); /* Update doc content silently on switch doc version, story #40503 */ - $('.panel').on('click', '#hisTrigger', function() - { - var $history = $('#history'); - var $icon = $(this); - if($history.hasClass('hidden')) - { - $history.removeClass('hidden'); - $icon.addClass('text-primary'); - } - else - { - $history.addClass('hidden'); - $icon.removeClass('text-primary'); - } - }).on('click', '#closeBtn', function() + $('.panel').on('click', '#closeBtn', function() { $('#history').addClass('hidden'); $('#hisTrigger').removeClass('text-primary'); @@ -100,3 +86,19 @@ $(function() $('#history').append(''); }); + +window.showHistory = function() +{ + var $history = $('#history'); + var $icon = $('#hisTrigger'); + if($history.hasClass('hidden')) + { + $history.removeClass('hidden'); + $icon.addClass('text-primary'); + } + else + { + $history.addClass('hidden'); + $icon.removeClass('text-primary'); + } +} diff --git a/module/api/ui/view.html.php b/module/api/ui/view.html.php index 419f5c3503..b05212024f 100644 --- a/module/api/ui/view.html.php +++ b/module/api/ui/view.html.php @@ -263,7 +263,9 @@ div setID('hisTrigger'), set::url('###)'), setClass('btn ghost'), - icon('clock') + icon('clock'), + set('data-on', 'click'), + set('data-call', 'showHistory') ) ) )