Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for dynamic menus and IE fixes. #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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


19 changes: 12 additions & 7 deletions js/jquery.dlmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( '<li class="dl-back"><a href="#">' + this.options.backLabel + '</a></li>' );
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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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' ),
Expand Down Expand Up @@ -216,6 +216,8 @@
onTransitionEndFn.call();
}

this.$menu.hide();

this.open = false;
},
openMenu : function() {
Expand All @@ -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() ;
Expand All @@ -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' );
}
};

Expand Down