From 74aff73a9bc8266c76aa02c6e51e0bc05cb7bc6c Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 25 Sep 2014 19:37:38 +0200 Subject: [PATCH] added pusherId option allows using multiple instances --- js/mlpushmenu.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/mlpushmenu.js b/js/mlpushmenu.js index 699b754..577a40d 100644 --- a/js/mlpushmenu.js +++ b/js/mlpushmenu.js @@ -76,7 +76,9 @@ // space between each overlaped level levelSpacing : 40, // classname for the element (if any) that when clicked closes the current level - backClass : 'mp-back' + backClass : 'mp-back', + // wrapperId for the moving wrapper + pusherId : 'mp-pusher' }, _init : function() { // if menu is open or not @@ -84,7 +86,7 @@ // level depth this.level = 0; // the moving wrapper - this.wrapper = document.getElementById( 'mp-pusher' ); + this.wrapper = document.getElementById( this.options.pusherId ); // the mp-level elements this.levels = Array.prototype.slice.call( this.el.querySelectorAll( 'div.mp-level' ) ); // save the depth of each of these mp-level elements