From 00753d20a9e47a5a75421a5d25779cf3d589e2a8 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sat, 17 May 2014 18:56:15 +0200 Subject: [PATCH] Import upstream theme changes --- _assets/javascripts/plugins/jquery.dlmenu.js | 31 +++++++++++--------- _assets/stylesheets/dl-menu.less | 8 ++--- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/_assets/javascripts/plugins/jquery.dlmenu.js b/_assets/javascripts/plugins/jquery.dlmenu.js index 52f7bba..3209914 100644 --- a/_assets/javascripts/plugins/jquery.dlmenu.js +++ b/_assets/javascripts/plugins/jquery.dlmenu.js @@ -4,7 +4,7 @@ * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php - * + * * Copyright 2013, Codrops * http://www.codrops.com */ @@ -39,7 +39,7 @@ this.options = $.extend( true, {}, $.DLMenu.defaults, options ); // cache some elements and initialize some variables this._config(); - + var animEndEventNames = { 'WebkitAnimation' : 'webkitAnimationEnd', 'OAnimation' : 'oAnimationEnd', @@ -77,10 +77,10 @@ var self = this; this.$trigger.on( 'click.dlmenu', function() { - + if( self.open ) { self._closeMenu(); - } + } else { self._openMenu(); } @@ -89,7 +89,7 @@ } ); this.$menuitems.on( 'click.dlmenu', function( event ) { - + event.stopPropagation(); var $item = $(this), @@ -97,7 +97,10 @@ 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() { 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' ); @@ -127,7 +130,7 @@ } ); this.$back.on( 'click.dlmenu', function( event ) { - + var $this = $( this ), $submenu = $this.parents( 'ul.dl-submenu:first' ), $item = $submenu.parent(), @@ -150,7 +153,7 @@ } $item.removeClass( 'dl-subviewopen' ); - + var $subview = $this.parents( '.dl-subview:first' ); if( $subview.is( 'li' ) ) { $subview.addClass( 'dl-subviewopen' ); @@ -161,7 +164,7 @@ return false; } ); - + }, closeMenu : function() { if( this.open ) { @@ -174,11 +177,11 @@ self.$menu.off( self.transEndEventName ); self._resetMenu(); }; - + this.$menu.removeClass( 'dl-menuopen' ); this.$menu.addClass( 'dl-menu-toggle' ); this.$trigger.removeClass( 'dl-active' ); - + if( this.supportTransitions ) { this.$menu.on( this.transEndEventName, onTransitionEndFn ); } @@ -234,9 +237,9 @@ } instance[ options ].apply( instance, args ); }); - } + } else { - this.each(function() { + this.each(function() { var instance = $.data( this, 'dlmenu' ); if ( instance ) { instance._init(); @@ -249,4 +252,4 @@ return this; }; -} )( jQuery, window ); \ No newline at end of file +} )( jQuery, window ); diff --git a/_assets/stylesheets/dl-menu.less b/_assets/stylesheets/dl-menu.less index 5e35c8f..13ddab9 100644 --- a/_assets/stylesheets/dl-menu.less +++ b/_assets/stylesheets/dl-menu.less @@ -93,11 +93,11 @@ color: @white; outline: none; } - .dl-back > a { + &.dl-back > a { padding-left: 30px; background: rgba(0,0,0,0.2); } - .dl-back:after, + &.dl-back:after, > a:not(:only-child):after { position: absolute; top: 0; @@ -108,7 +108,7 @@ -webkit-font-smoothing: antialiased; content: "\f105"; } - .dl-back:after { + &.dl-back:after { left: 10px; color: rgba(212,204,198,0.5); -webkit-transform: rotate(180deg); @@ -352,4 +352,4 @@ All this is done for any sub-level being entered. } .dl-menuopen li { display: block -} \ No newline at end of file +}