Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Enable isPropagationStopped; fix order of evalating <script> #550

Closed
wants to merge 2 commits into from

3 participants

@2y
2y commented

pull request for zepto to act like jquery

Yuta Yamashita added some commits
Yuta Yamashita Change the order of evaluating the script content
In jQuery, all the nodes appeared before a script tag are inserted when
the script content is evaluated, but in zepto, all nodes before the
script is inserted *after* the script is evaluated.
Changed it to behave the same with jQuery.
a107ace
Yuta Yamashita bug fix for enabling "isPropagationStopped" d0a00a9
@madrobby
Owner

Thanks for the patch. We need to have proper unit tests before this can go in.

@mislav mislav closed this pull request from a commit
@mislav mislav rewrite after/prepend/before/append() to fix eval
In some of these operations <script> tags would be eval'ed in the wrong
order. The rewrite ensures a consistent eval order and improves code
readability.

Closes #550
17f69f4
@mislav mislav closed this in 17f69f4
@lopper lopper referenced this pull request from a commit in buddydvd/zepto
@mislav mislav rewrite after/prepend/before/append() to fix eval
In some of these operations <script> tags would be eval'ed in the wrong
order. The rewrite ensures a consistent eval order and improves code
readability.

Closes #550
4caab90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2012
  1. Change the order of evaluating the script content

    Yuta Yamashita authored
    In jQuery, all the nodes appeared before a script tag are inserted when
    the script content is evaluated, but in zepto, all nodes before the
    script is inserted *after* the script is evaluated.
    Changed it to behave the same with jQuery.
  2. bug fix for enabling "isPropagationStopped"

    Yuta Yamashita authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +1 −1  src/event.js
  2. +2 −2 src/zepto.js
View
2  src/event.js
@@ -41,7 +41,7 @@
var delegate = getDelegate && getDelegate(fn, event),
callback = delegate || fn
var proxyfn = function (event) {
- var result = callback.apply(element, [event].concat(event.data))
+ var result = callback.apply(element, [createProxy(event)].concat(event.data))
if (result === false) event.preventDefault()
return result
}
View
4 src/zepto.js
@@ -571,13 +571,13 @@ var Zepto = (function() {
return this.each(function(index, target){
for (var i = 0; i < nodes.length; i++) {
+ if (copyByClone && index < size - 1) node = node.cloneNode(true)
+ insert(operator, target, node)
var node = nodes[inReverse ? nodes.length-i-1 : i]
traverseNode(node, function(node){
if (node.nodeName != null && node.nodeName.toUpperCase() === 'SCRIPT' && (!node.type || node.type === 'text/javascript'))
window['eval'].call(window, node.innerHTML)
})
- if (copyByClone && index < size - 1) node = node.cloneNode(true)
- insert(operator, target, node)
}
})
}
Something went wrong with that request. Please try again.