Import upstream theme changes
This commit is contained in:
parent
d3b8966db4
commit
00753d20a9
2 changed files with 21 additions and 18 deletions
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
*
|
*
|
||||||
* Copyright 2013, Codrops
|
* Copyright 2013, Codrops
|
||||||
* http://www.codrops.com
|
* http://www.codrops.com
|
||||||
*/
|
*/
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
this.options = $.extend( true, {}, $.DLMenu.defaults, options );
|
this.options = $.extend( true, {}, $.DLMenu.defaults, options );
|
||||||
// cache some elements and initialize some variables
|
// cache some elements and initialize some variables
|
||||||
this._config();
|
this._config();
|
||||||
|
|
||||||
var animEndEventNames = {
|
var animEndEventNames = {
|
||||||
'WebkitAnimation' : 'webkitAnimationEnd',
|
'WebkitAnimation' : 'webkitAnimationEnd',
|
||||||
'OAnimation' : 'oAnimationEnd',
|
'OAnimation' : 'oAnimationEnd',
|
||||||
|
@ -77,10 +77,10 @@
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.$trigger.on( 'click.dlmenu', function() {
|
this.$trigger.on( 'click.dlmenu', function() {
|
||||||
|
|
||||||
if( self.open ) {
|
if( self.open ) {
|
||||||
self._closeMenu();
|
self._closeMenu();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self._openMenu();
|
self._openMenu();
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
} );
|
} );
|
||||||
|
|
||||||
this.$menuitems.on( 'click.dlmenu', function( event ) {
|
this.$menuitems.on( 'click.dlmenu', function( event ) {
|
||||||
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
var $item = $(this),
|
var $item = $(this),
|
||||||
|
@ -97,7 +97,10 @@
|
||||||
|
|
||||||
if( $submenu.length > 0 ) {
|
if( $submenu.length > 0 ) {
|
||||||
|
|
||||||
var $flyin = $submenu.clone().css( 'opacity', 0 ).insertAfter( self.$menu ),
|
var $flyin = $submenu.clone().css({
|
||||||
|
opacity: 0,
|
||||||
|
margin: 0
|
||||||
|
}).insertAfter( self.$menu ),
|
||||||
onAnimationEndFn = function() {
|
onAnimationEndFn = function() {
|
||||||
self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classout ).addClass( 'dl-subview' );
|
self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classout ).addClass( 'dl-subview' );
|
||||||
$item.addClass( 'dl-subviewopen' ).parents( '.dl-subviewopen:first' ).removeClass( 'dl-subviewopen' ).addClass( 'dl-subview' );
|
$item.addClass( 'dl-subviewopen' ).parents( '.dl-subviewopen:first' ).removeClass( 'dl-subviewopen' ).addClass( 'dl-subview' );
|
||||||
|
@ -127,7 +130,7 @@
|
||||||
} );
|
} );
|
||||||
|
|
||||||
this.$back.on( 'click.dlmenu', function( event ) {
|
this.$back.on( 'click.dlmenu', function( event ) {
|
||||||
|
|
||||||
var $this = $( this ),
|
var $this = $( this ),
|
||||||
$submenu = $this.parents( 'ul.dl-submenu:first' ),
|
$submenu = $this.parents( 'ul.dl-submenu:first' ),
|
||||||
$item = $submenu.parent(),
|
$item = $submenu.parent(),
|
||||||
|
@ -150,7 +153,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$item.removeClass( 'dl-subviewopen' );
|
$item.removeClass( 'dl-subviewopen' );
|
||||||
|
|
||||||
var $subview = $this.parents( '.dl-subview:first' );
|
var $subview = $this.parents( '.dl-subview:first' );
|
||||||
if( $subview.is( 'li' ) ) {
|
if( $subview.is( 'li' ) ) {
|
||||||
$subview.addClass( 'dl-subviewopen' );
|
$subview.addClass( 'dl-subviewopen' );
|
||||||
|
@ -161,7 +164,7 @@
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
},
|
},
|
||||||
closeMenu : function() {
|
closeMenu : function() {
|
||||||
if( this.open ) {
|
if( this.open ) {
|
||||||
|
@ -174,11 +177,11 @@
|
||||||
self.$menu.off( self.transEndEventName );
|
self.$menu.off( self.transEndEventName );
|
||||||
self._resetMenu();
|
self._resetMenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$menu.removeClass( 'dl-menuopen' );
|
this.$menu.removeClass( 'dl-menuopen' );
|
||||||
this.$menu.addClass( 'dl-menu-toggle' );
|
this.$menu.addClass( 'dl-menu-toggle' );
|
||||||
this.$trigger.removeClass( 'dl-active' );
|
this.$trigger.removeClass( 'dl-active' );
|
||||||
|
|
||||||
if( this.supportTransitions ) {
|
if( this.supportTransitions ) {
|
||||||
this.$menu.on( this.transEndEventName, onTransitionEndFn );
|
this.$menu.on( this.transEndEventName, onTransitionEndFn );
|
||||||
}
|
}
|
||||||
|
@ -234,9 +237,9 @@
|
||||||
}
|
}
|
||||||
instance[ options ].apply( instance, args );
|
instance[ options ].apply( instance, args );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.each(function() {
|
this.each(function() {
|
||||||
var instance = $.data( this, 'dlmenu' );
|
var instance = $.data( this, 'dlmenu' );
|
||||||
if ( instance ) {
|
if ( instance ) {
|
||||||
instance._init();
|
instance._init();
|
||||||
|
@ -249,4 +252,4 @@
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
} )( jQuery, window );
|
} )( jQuery, window );
|
||||||
|
|
|
@ -93,11 +93,11 @@
|
||||||
color: @white;
|
color: @white;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.dl-back > a {
|
&.dl-back > a {
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
background: rgba(0,0,0,0.2);
|
background: rgba(0,0,0,0.2);
|
||||||
}
|
}
|
||||||
.dl-back:after,
|
&.dl-back:after,
|
||||||
> a:not(:only-child):after {
|
> a:not(:only-child):after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
content: "\f105";
|
content: "\f105";
|
||||||
}
|
}
|
||||||
.dl-back:after {
|
&.dl-back:after {
|
||||||
left: 10px;
|
left: 10px;
|
||||||
color: rgba(212,204,198,0.5);
|
color: rgba(212,204,198,0.5);
|
||||||
-webkit-transform: rotate(180deg);
|
-webkit-transform: rotate(180deg);
|
||||||
|
@ -352,4 +352,4 @@ All this is done for any sub-level being entered.
|
||||||
}
|
}
|
||||||
.dl-menuopen li {
|
.dl-menuopen li {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue