diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..500e2aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,83 @@ +# Created by .ignore support plugin (hsz.mobi) +### Eclipse template +*.pydevproject +.metadata +.gradle +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + +# sbteclipse plugin +.target + +# TeXlipse plugin +.texlipse + + +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + diff --git a/js/jquery.dlmenu.js b/js/jquery.dlmenu.js index 6f26cec..dc1493f 100755 --- a/js/jquery.dlmenu.js +++ b/js/jquery.dlmenu.js @@ -74,13 +74,13 @@ this.open = false; this.$trigger = this.$el.children( '.dl-trigger' ); this.$menu = this.$el.children( 'ul.dl-menu' ); - this.$menuitems = this.$menu.find( 'li:not(.dl-back)' ); + this.$menu.hide(); + this.$el.css('z-index', '9999') this.$el.find( 'ul.dl-submenu' ).prepend( '
  • ' + this.options.backLabel + '
  • ' ); - this.$back = this.$menu.find( 'li.dl-back' ); // Set the label text for the back link. if (this.options.useActiveItemAsBackLabel) { - this.$back.each(function() { + this.$menu.find( 'li.dl-back' ).each(function() { var $this = $(this), parentLabel = $this.parents('li:first').find('a:first').text(); @@ -111,12 +111,12 @@ $body.off( 'click' ).children().on( 'click.dlmenu', function() { self._closeMenu() ; } ); - + } return false; } ); - this.$menuitems.on( 'click.dlmenu', function( event ) { + this.$menu.on( 'click.dlmenu', 'li:not(.dl-back)', function( event ) { event.stopPropagation(); @@ -156,7 +156,7 @@ } ); - this.$back.on( 'click.dlmenu', function( event ) { + this.$menu.on( 'click.dlmenu', 'li.dl-back', function( event ) { var $this = $( this ), $submenu = $this.parents( 'ul.dl-submenu:first' ), @@ -216,6 +216,8 @@ onTransitionEndFn.call(); } + this.$menu.hide(); + this.open = false; }, openMenu : function() { @@ -225,6 +227,9 @@ }, _openMenu : function() { var self = this; + + this.$menu.show(); + // clicking somewhere else makes the menu close $body.off( 'click' ).on( 'click.dlmenu', function() { self._closeMenu() ; @@ -238,7 +243,7 @@ // resets the menu to its original state (first level of options) _resetMenu : function() { this.$menu.removeClass( 'dl-subview' ); - this.$menuitems.removeClass( 'dl-subview dl-subviewopen' ); + this.$menu.find( 'li:not(.dl-back)' ).removeClass( 'dl-subview dl-subviewopen' ); } };