Skip to content

Commit

Permalink
new param, copyBoundEvents
Browse files Browse the repository at this point in the history
copy any events bound to the existing DOM, useful if navobile is bound at certain screen sizes
  • Loading branch information
Seb Ashton committed Jul 3, 2014
1 parent 143d07f commit 180d92f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ There are a few parameters for the plugin, they are mostly optional.
* content - the selector that wraps the content that will slide out (default: '#content')
* easing - jQuery easing function to use in $.animate fallback (default: 'linear') for more easing options you will require [jQuery.easing](http://gsgd.co.uk/sandbox/jquery/easing/)
* changeDOM - Boolean, whether the plugin needs to move the navigation in the DOM structure (default: false)
* copyBoundEvents - Boolean, if changeDOM is true, whether to or not to copy across any bound events (default: false)
* openOffsetLeft - String, the percentage you want navobile to open (default: '80%') N.B. If you alter this you will also need to change the width of [.navobile-navigation](https://github.com/madebymade/jquery-navobile/blob/master/src/jquery.navobile.css#L40)
* hammerOptions - a Javascript object containing the options detailed here: https://github.com/EightMedia/hammer.js/wiki/Getting-Started#gesture-options. Only needed if you are using bindSwipe/bindDrag (default: {})

Expand Down
3 changes: 2 additions & 1 deletion navobile.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"mobile",
"navigation",
"menu",
"touch"
"touch",
"off canvas"
],
"version": "0.2.6",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"bugs": {
"url": "https://github.com/madebymade/jquery-navobile/issues"
},
"homepage": "https://github.com/madebymade/jquery-navobile"
"homepage": "https://madebymade.github.io/jquery-navobile/"
}
5 changes: 3 additions & 2 deletions src/jquery.navobile.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###
Copyright (c) 2013, Made By Made Ltd
Copyright (c) 2014, Made By Made Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -206,7 +206,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
base.options = $.extend({}, $.navobile.settings, options)
base.$cta = $(base.options.cta)
base.$content = $(base.options.content)
base.$nav = if base.options.changeDOM then base.$el.clone(true, true) else base.$el
base.$nav = if base.options.changeDOM then base.$el.clone(base.options.copyBoundEvents) else base.$el
base.$content.addClass 'navobile-content'

if $('#navobile-device-pixel').length is 0
Expand Down Expand Up @@ -236,6 +236,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
content: '#content'
easing: 'linear'
changeDOM: false
copyBoundEvents: false
bindSwipe: false
bindDrag: false
openOffsetLeft: '80%'
Expand Down
7 changes: 4 additions & 3 deletions src/jquery.navobile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2013, Made By Made Ltd
Copyright (c) 2014, Made By Made Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand All @@ -23,7 +23,7 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/

(function() {
(function(window, $) {
Expand Down Expand Up @@ -205,7 +205,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
base.options = $.extend({}, $.navobile.settings, options);
base.$cta = $(base.options.cta);
base.$content = $(base.options.content);
base.$nav = base.options.changeDOM ? base.$el.clone() : base.$el;
base.$nav = base.options.changeDOM ? base.$el.clone(base.options.copyBoundEvents) : base.$el;
base.$content.addClass('navobile-content');
if ($('#navobile-device-pixel').length === 0) {
$('body').append('<div id="navobile-device-pixel" />');
Expand Down Expand Up @@ -235,6 +235,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
content: '#content',
easing: 'linear',
changeDOM: false,
copyBoundEvents: false,
bindSwipe: false,
bindDrag: false,
openOffsetLeft: '80%',
Expand Down
6 changes: 3 additions & 3 deletions src/jquery.navobile.min.js

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

0 comments on commit 180d92f

Please sign in to comment.