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

Fix for clicking elsewhere closes menu #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wizard04wsu
Copy link

The menu wasn't closing when clicking outside of it. Also, it shouldn't remove all click handlers from the body.

@kcockerill
Copy link

It should allow removal of it's own click handler:

Index: jquery.dlmenu.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8

--- jquery.dlmenu.js (revision c213da44d821bce9475bee48d1b159eb8c064203)
+++ jquery.dlmenu.js (date 1543938663876)
@@ -195,11 +195,11 @@
},
_openMenu : function() {
var self = this;

  •   	// clicking somewhere else makes the menu close
    
  •   	$body.off( 'click' ).on( 'click.dlmenu', function() {
    
  •   		self._closeMenu() ;
    
  •   	} );
    
  •   	this.$menu.addClass( 'dl-menuopen dl-menu-toggle' ).on( this.transEndEventName, function() {
    
  •        // clicking somewhere else makes the menu close
    
  •        $body.off( 'click.dlmenu' ).on( 'click.dlmenu', function() {
    
  •            self._closeMenu() ;
    
  •        } );
    
  •        this.$menu.addClass( 'dl-menuopen dl-menu-toggle' ).on( this.transEndEventName, function() {
      		$( this ).removeClass( 'dl-menu-toggle' );
      	} );
      	this.$trigger.addClass( 'dl-active' );
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants