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 possibility to let others sidr opened when opening a new one #181

Open
wants to merge 2 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
9 changes: 6 additions & 3 deletions dist/jquery.sidr.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
speed = $menu.data('speed'),
side = $menu.data('side'),
displace = $menu.data('displace'),
closeOthers = $menu.data('closeOthers'),
onOpen = $menu.data('onOpen'),
onClose = $menu.data('onClose'),
bodyAnimation,
Expand All @@ -78,7 +79,7 @@
}

// If another menu opened close first
if(sidrOpened !== false) {
if(sidrOpened !== false && closeOthers === true) {
methods.close(sidrOpened, function() {
methods.open(name);
});
Expand Down Expand Up @@ -217,7 +218,8 @@
source : null, // Override the source of the content.
renaming : true, // The ids and classes will be prepended with a prefix when loading existent content
body : 'body', // Page container selector,
displace: true, // Displace the body content or not
displace : true, // Displace the body content or not
closeOthers : true, // If true, others menus will be closed when sidr opened
onOpen : function() {}, // Callback when sidr opened
onClose : function() {} // Callback when sidr closed
}, options);
Expand All @@ -240,7 +242,8 @@
speed : settings.speed,
side : settings.side,
body : settings.body,
displace : settings.displace,
displace : settings.displace,
closeOthers : settings.closeOthers,
onOpen : settings.onOpen,
onClose : settings.onClose
});
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-contrib-compass": "^0.8.0",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-uglify": "~0.1.2",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-compass": "~0.1.3",
"grunt-contrib-watch": "~0.3.1"
}
}
4 changes: 4 additions & 0 deletions package/jquery.sidr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/jquery.sidr.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
speed = $menu.data('speed'),
side = $menu.data('side'),
displace = $menu.data('displace'),
closeOthers = $menu.data('closeOthers'),
onOpen = $menu.data('onOpen'),
onClose = $menu.data('onClose'),
bodyAnimation,
Expand All @@ -78,7 +79,7 @@
}

// If another menu opened close first
if(sidrOpened !== false) {
if(sidrOpened !== false && closeOthers === true) {
methods.close(sidrOpened, function() {
methods.open(name);
});
Expand Down Expand Up @@ -217,7 +218,8 @@
source : null, // Override the source of the content.
renaming : true, // The ids and classes will be prepended with a prefix when loading existent content
body : 'body', // Page container selector,
displace: true, // Displace the body content or not
displace : true, // Displace the body content or not
closeOthers : true, // If true, others menus will be closed when sidr opened
onOpen : function() {}, // Callback when sidr opened
onClose : function() {} // Callback when sidr closed
}, options);
Expand All @@ -240,7 +242,8 @@
speed : settings.speed,
side : settings.side,
body : settings.body,
displace : settings.displace,
displace : settings.displace,
closeOthers : settings.closeOthers,
onOpen : settings.onOpen,
onClose : settings.onClose
});
Expand Down