backbone_extensions 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,22 @@
|
|
1
1
|
(function(_, Backbone) {
|
2
2
|
'use strict';
|
3
3
|
function bindModelEvents(tuple) {
|
4
|
-
var self = this, subject = tuple[0], eventNames = tuple[1], modelEvents = self._modelEvents;
|
4
|
+
var self = this, subject = tuple[0], isJquery = !!_(subject).result('jquery'), eventNames = tuple[1], modelEvents = self._modelEvents;
|
5
5
|
modelEvents.push(tuple);
|
6
6
|
|
7
7
|
_(subject && eventNames).each(function(callback, event) {
|
8
8
|
_(event.split(' ')).each(function(e) {
|
9
9
|
_([callback]).chain().flatten().each(function(c) {
|
10
10
|
if (_(c).isFunction()) {
|
11
|
-
|
11
|
+
if (isJquery) {
|
12
|
+
subject.on(e, c);
|
13
|
+
} else {
|
14
|
+
subject.on(e, c, self);
|
15
|
+
}
|
12
16
|
} else {
|
13
|
-
|
17
|
+
if (!isJquery) {
|
18
|
+
subject.on(e, self[c], self);
|
19
|
+
}
|
14
20
|
}
|
15
21
|
});
|
16
22
|
});
|
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.21
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-02-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fuubar
|
@@ -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: -3936213747677424289
|
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: -3936213747677424289
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
141
|
rubygems_version: 1.8.24
|