backbone_extensions 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,6 @@
|
|
4
4
|
var self = this, subject = tuple[0], eventNames = tuple[1], isJquery = !!_(subject).result('jquery'),
|
5
5
|
modelEvents = self._modelCallbacks, context = tuple[2];
|
6
6
|
modelEvents.push(tuple);
|
7
|
-
|
8
7
|
_(subject && eventNames).each(function(callback, event) {
|
9
8
|
_(event.split(' ')).each(function(e) {
|
10
9
|
_([callback]).chain().flatten().each(function(c) {
|
@@ -26,15 +25,19 @@
|
|
26
25
|
function unbindModelEvents() {
|
27
26
|
var self = this, modelEvents = self._modelCallbacks;
|
28
27
|
_(modelEvents).each(function(tuple) {
|
29
|
-
var subject = tuple[0], events = tuple[1];
|
30
|
-
|
28
|
+
var subject = tuple[0], events = tuple[1], context = tuple[2], isJquery = !!_(subject).result('jquery');
|
31
29
|
_(subject && events).each(function(callback, event) {
|
32
30
|
_(event.split(' ')).each(function(e) {
|
33
31
|
_([callback]).chain().flatten().each(function(c) {
|
34
|
-
|
35
|
-
|
32
|
+
var fn = _(c).isFunction() ? c : self[c];
|
33
|
+
if (isJquery) {
|
34
|
+
if (context) {
|
35
|
+
subject.off(e, context, fn);
|
36
|
+
} else {
|
37
|
+
subject.off(e, fn);
|
38
|
+
}
|
36
39
|
} else {
|
37
|
-
subject.off(e,
|
40
|
+
subject.off(e, fn);
|
38
41
|
}
|
39
42
|
});
|
40
43
|
});
|
@@ -59,12 +62,11 @@
|
|
59
62
|
}),
|
60
63
|
|
61
64
|
delegateEvents: _(source.prototype.delegateEvents).wrap(function(oldDelegateEvents) {
|
62
|
-
var self = this, args = _(arguments).rest(
|
65
|
+
var self = this, args = _(arguments).rest();
|
63
66
|
|
64
67
|
if (!args.length) {
|
65
68
|
return oldDelegateEvents.call(this);
|
66
69
|
}
|
67
|
-
|
68
70
|
wrapUndelegateEvents.call(this, function() {
|
69
71
|
_(args).chain().toArray().compact().each(function(obj) {
|
70
72
|
var arg = _(obj);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backbone_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
segments:
|
128
128
|
- 0
|
129
|
-
hash:
|
129
|
+
hash: 4389807345042330580
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
none: false
|
132
132
|
requirements:
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
segments:
|
137
137
|
- 0
|
138
|
-
hash:
|
138
|
+
hash: 4389807345042330580
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
141
|
rubygems_version: 1.8.21
|