Skip to content

Commit

Permalink
fix binding selectors overwriting events selectors issue #49
Browse files Browse the repository at this point in the history
  • Loading branch information
delambo committed Jan 17, 2013
1 parent 8c3198f commit 8baa62d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8,942 deletions.
3 changes: 2 additions & 1 deletion backbone.stickit.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
props = ['autofocus', 'autoplay', 'async', 'checked', 'controls', 'defer', 'disabled', 'hidden', 'loop', 'multiple', 'open', 'readonly', 'required', 'scoped', 'selected'];

this._modelBindings || (this._modelBindings = []);

this.unstickModel(model);

this.events || (this.events = {});
Expand Down Expand Up @@ -115,7 +116,7 @@
if (isFormEl($el) || isContenteditable($el)) {
// Bind events to the element which will update the model with changes.
_.each(config.eventsOverride || getModelEvents($el), function(type) {
self.events[type+' '+selector] = function() {
self.events[type+'.stickit '+selector] = function() {
var val = getElVal($el, isContenteditable($el));
// Don't update the model if false is returned from the `updateModel` configuration.
if (evaluateBoolean(self, config.updateModel, val, modelAttr))
Expand Down
4 changes: 2 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<link rel="stylesheet" href="vendor/qunit.css" type="text/css"/>

<script type="text/javascript" src="vendor/zepto.js"></script>
<script type="text/javascript" src="vendor/jquery-1.6.1.js"></script>
<script type="text/javascript" src="http://zeptojs.com/zepto.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
Expand Down
Loading

0 comments on commit 8baa62d

Please sign in to comment.