-
Notifications
You must be signed in to change notification settings - Fork 232
Bb view hooks #780
base: master
Are you sure you want to change the base?
Bb view hooks #780
Conversation
@@ -15,7 +15,7 @@ filterChildren = (nodeList, selector) -> | |||
|
|||
toggleElement = do -> | |||
if $ | |||
(elem, visible) -> elem.toggle visible | |||
(elem, visible) -> $(elem).toggle visible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downside of always passing a non-jq wrapped element is that we have to re-wrap it. jQuery methods like toggle
aren't easily recreated in native code so easiest to leave them around.
For things like addClass
, it may make sense to force people to provide a polyfill if they need older browsers.
tests are not passing |
Working on it |
Fix tests for Chaplin#780
Follow up for Chaplin#780
@@ -6,12 +6,13 @@ | |||
"expect": "0.2.x", | |||
"jquery": "1.9.x", | |||
"lodash": "2.3.x", | |||
"backbone": "1.1.x", | |||
"backbone": "git://github.com/jashkenas/backbone#3994c1cb8592c7e30613e9f869fe60c1cdce6164", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? Is it unstable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah we have to fix that. Should read >1.2.0 now
On Mon, May 18, 2015, 21:55 Paul Miller notifications@github.com wrote:
In bower.json
#780 (comment):@@ -6,12 +6,13 @@
"expect": "0.2.x",
"jquery": "1.9.x",
"lodash": "2.3.x",
- "backbone": "1.1.x",
- "backbone": "git://github.com/jashkenas/backbone#3994c1cb8592c7e30613e9f869fe60c1cdce6164",
? Is it unstable?
—
Reply to this email directly or view it on GitHub
https://github.com/chaplinjs/chaplin/pull/780/files#r30563667.
Fix failing tests without jQuery
Basic gist:
@el
to@$el
in library code like Chaplin).view.$
now returns an array-like (has numeric length) object, meaning useview.$(selector)[0]
to get an el instance, orfor el in view.$(selector)
for a list (dont rely on auto jquery each differences.delegate
method that allows us to replace direct calls to$el.on
, and more importantly allows us to remove thedelegateEvents
workaround. We no longer need akeepOld
param since we can just calldelegate
directly without blowing away old ones with undelegateEvents each time.Still some tests failing.