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
1.7 KiB

/*!
* remark (http://getbootstrapadmin.com/remark)
* Copyright 2016 amazingsurge
* Licensed under the Themeforest Standard Licenses
*/
$.components.register("verticalTab",{mode:"init",init:function(context){$.fn.matchHeight&&$(".nav-tabs-vertical",context).each(function(){$(this).children().matchHeight()})}}),$.components.register("horizontalTab",{mode:"init",init:function(context){$.fn.responsiveHorizontalTabs&&$(".nav-tabs-horizontal",context).responsiveHorizontalTabs()}}),$.components.register("navTabsLine",{mode:"init",defaults:{speed:"0.5s, 1s",animate:"cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1)",tpl:function(){return'<li class="nav-tabs-autoline"></li>'}},init:function(context){var defaults=$.components.getDefaults("navTabsLine");$(".nav-tabs-line",context).each(function(){var $this=$(this),options=$.extend({},defaults,$this.data()),$parent=$this.parent(),$active=$this.find(".active"),$autoLineTpl=$(options.tpl()).css({"-webkit-transition-duration":options.speed,"transition-duration":options.speed,"-webkit-transition-timing-function":options.animate,"transition-timing-function":options.animate});$autoLineTpl.appendTo($this);var horizontalLine=function($this){var left=$this.position().left,lineWidth=$this.outerWidth();$autoLineTpl.css({left:left,width:lineWidth})},verticalLine=function($this){var top=$this.position().top,lineHeight=$this.outerHeight();$autoLineTpl.css({top:top,height:lineHeight})},change=function($this){$parent.hasClass("nav-tabs-vertical")?verticalLine($this):horizontalLine($this)};$this.on("shown.bs.tab",'a[data-toggle="tab"]',function(){var $li=$(this).parent(),$ul=$li.parent();change($ul.hasClass("dropdown-menu")?$ul.parent():$(this).parent())}),change($active)})}});