Skip to content

Commit

Permalink
opened bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
FrDH committed May 10, 2014
1 parent 703ef29 commit a866792
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jQuery.mmenu",
"main": "src/js/jquery.mmenu.js",
"version": "4.2.6",
"version": "4.2.7",
"homepage": "http://mmenu.frebsite.nl/",
"authors": [
"Fred Heusschen <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion mmenu.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmenu",
"version": "4.2.6",
"version": "4.2.7",
"title": "jQuery mmenu",
"description": "A jQuery plugin that creates slick app look-alike sliding menus for your (mobile) website with horizontal or vertical submenus. It's easy to customize and has options for headers, labels, counters, a searchfield and more.",
"homepage": "http://mmenu.frebsite.nl",
Expand Down
21 changes: 16 additions & 5 deletions src/js/jquery.mmenu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery mmenu v4.2.6
* jQuery mmenu v4.2.7
* @requires jQuery 1.7.0 or later
*
* mmenu.frebsite.nl
Expand All @@ -16,7 +16,7 @@
(function( $ ) {

var _PLUGIN_ = 'mmenu',
_VERSION_ = '4.2.6';
_VERSION_ = '4.2.7';


// Plugin already excists
Expand Down Expand Up @@ -49,7 +49,8 @@
this.opts = opts
this.conf = conf;

this.serialnr = _serialnr++;
this.opened = false;
this.serialnr = _serialnr++;

this._init();

Expand All @@ -60,6 +61,10 @@

open: function()
{
if ( this.opened )
{
return false;
}
var that = this;

this._openSetup();
Expand All @@ -77,7 +82,7 @@
},
_openSetup: function()
{
_strollTop = glbl.$wndw.scrollTop();
_strollTop = glbl.$wndw.scrollTop() || 0;

// Set opened
this.$menu.addClass( _c.current );
Expand Down Expand Up @@ -125,6 +130,7 @@
transitionend( glbl.$page,
function()
{
that.opened = true;
that.$menu.trigger( _e.opened );
}, this.conf.transitionDuration
);
Expand All @@ -137,6 +143,11 @@
{
var that = this;

if ( !this.opened )
{
return false;
}

// Callback
transitionend( glbl.$page,
function()
Expand All @@ -160,7 +171,7 @@
// Restore style and position
glbl.$page.attr( 'style', glbl.$page.data( _d.style ) );

// Closed
that.opened = false;
that.$menu.trigger( _e.closed );

}, this.conf.transitionDuration
Expand Down
Loading

0 comments on commit a866792

Please sign in to comment.