Skip to content

Commit

Permalink
Merge pull request #133 from mrothauer/master
Browse files Browse the repository at this point in the history
set container-selector with data attribute
  • Loading branch information
christophery authored Oct 24, 2019
2 parents c28033d + c8627b4 commit b3f8435
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/pushy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
(function ($) {
var pushy = $('.pushy'), //menu css class
body = $('body'),
container = $('#container'), //container css class
push = $('.push'), //css class to add pushy capability
pushyLeft = 'pushy-left', //css class for left menu position
pushyOpenLeft = 'pushy-open-left', //css class when menu is open (left position)
Expand All @@ -32,6 +31,14 @@

//css class to focus when menu is closed w/ esc key
var menuBtnFocus = $(menuBtnClass);

// check if container-selector data attribute exists
var containerSelector = '#container';
if (typeof pushy.data('container-selector') !== 'undefined') {
containerSelector = pushy.data('container-selector');
}
var container = $(containerSelector);


//close menu w/ esc key
$(document).keyup(function(e) {
Expand Down

0 comments on commit b3f8435

Please sign in to comment.