diff options
author | moisseev <moiseev@mezonplus.ru> | 2019-05-12 13:00:47 +0300 |
---|---|---|
committer | moisseev <moiseev@mezonplus.ru> | 2019-05-12 13:00:47 +0300 |
commit | 47a86a5406b52e3379aac3f21cb9338313bda973 (patch) | |
tree | c7d2b6b6f137fffb0e6b168550c30932e361d0bb /interface/js/lib | |
parent | 7482bf1ce76169463c01e32ce60154e27a74ec78 (diff) | |
download | rspamd-47a86a5406b52e3379aac3f21cb9338313bda973.tar.gz rspamd-47a86a5406b52e3379aac3f21cb9338313bda973.zip |
[WebUI] Add URL fragments (#) support
for tab switching
- Show the correct tab when the page is loaded if there is a hash in the URL.
- Changing the hash in the URL when the tab is changed.
- Change the tab when the hash changes in the URL (back / forward buttons).
Diffstat (limited to 'interface/js/lib')
-rw-r--r-- | interface/js/lib/jquery.stickytabs.min.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/interface/js/lib/jquery.stickytabs.min.js b/interface/js/lib/jquery.stickytabs.min.js new file mode 100644 index 000000000..96967ea43 --- /dev/null +++ b/interface/js/lib/jquery.stickytabs.min.js @@ -0,0 +1,9 @@ +/*! + * jQuery Plugin: Sticky Tabs + * + * @author Aidan Lister <aidan@php.net> + * @version 1.2.1 + * @see https://github.com/aidanlister/jquery-stickytabs + * @license MIT + */ +!function(c){c.fn.stickyTabs=function(o){function t(){var o="href"==n.selectorAttribute?window.location.hash:window.location.hash.substring(1),t=o?"a["+n.selectorAttribute+'="'+o+'"]':n.initialTab;c(t,i).tab("show"),setTimeout(l,1)}var i=this,n=c.extend({getHashCallback:function(o,t){return o},selectorAttribute:"href",backToTop:!1,initialTab:c("li.active > a",i)},o),l=function(){!0===n.backToTop&&window.scrollTo(0,0)};return t(),c(window).on("hashchange",t),c("a",i).on("click",function(o){var t=this.href.split("#")[1];!function(o){history&&history.pushState?history.pushState(null,null,window.location.pathname+window.location.search+"#"+o):(scrollV=document.body.scrollTop,scrollH=document.body.scrollLeft,window.location.hash=o,document.body.scrollTop=scrollV,document.body.scrollLeft=scrollH)}(n.getHashCallback(t,this)),setTimeout(l,1)}),this}}(jQuery);
\ No newline at end of file |