You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
2.2 KiB
6 lines
2.2 KiB
9 years ago
|
/*!
|
||
|
* remark (http://getbootstrapadmin.com/remark)
|
||
|
* Copyright 2016 amazingsurge
|
||
|
* Licensed under the Themeforest Standard Licenses
|
||
|
*/
|
||
|
!function(window,document,$){"use strict";var $body=$("body"),$html=$("html");$.site.menubar={opened:null,top:!1,$instance:null,auto:!0,init:function(){if($html.removeClass("css-menubar").addClass("js-menubar"),this.$instance=$(".site-menubar"),0!==this.$instance.length){var self=this;this.$instance.on("changed.site.menubar",function(){self.update()}),this.hoverscroll.enable(),this.change()}},change:function(){var breakpoint=Breakpoints.current();$body.hasClass("site-menubar-keep")&&$body.hasClass("site-menubar-hide")?(this.hide(),breakpoint&&$body.hasClass("site-menubar-unfold")&&"xs"===breakpoint.name&&this.hide()):(this.reset(),breakpoint&&("xs"===breakpoint.name?this.hide():this.unfold()))},animate:function(doing,callback){var self=this;$body.addClass("site-menubar-changing"),doing.call(self),this.$instance.trigger("changing.site.menubar"),setTimeout(function(){callback.call(self),$body.removeClass("site-menubar-changing"),self.$instance.trigger("changed.site.menubar")},500)},reset:function(){this.opened=null,$body.removeClass("site-menubar-hide site-menubar-unfold")},hide:function(){this.opened!==!1&&this.animate(function(){$body.removeClass("site-menubar-unfold").addClass("site-menubar-hide"),this.opened=!1},function(){})},unfold:function(){this.opened!==!0&&this.animate(function(){$body.removeClass("site-menubar-hide").addClass("site-menubar-unfold"),this.opened=!0},function(){$.site.resize()})},toggle:function(){var opened=(Breakpoints.current(),this.opened);opened?this.hide():this.unfold()},update:function(){this.hoverscroll.update()},hoverscroll:{api:null,init:function(){this.api=$.site.menubar.$instance.children(".site-menubar-body").asHoverScroll({namespace:"hoverscorll",direction:"vertical",list:".site-menu",item:"> .site-menu-item",exception:".site-menu-sub",fixed:!1,boundary:100,onEnter:function(){},onLeave:function(){}}).data("asHoverScroll")},update:function(){this.api&&this.api.update()},enable:function(){this.api||this.init(),this.api&&this.api.enable()},disable:function(){this.api&&this.api.disable()}}}}(window,document,jQuery);
|