Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Prevent touch module from binding the same events twice, delegate $.parseJSON to JSON.parse #537

Closed
wants to merge 2 commits into from

2 participants

David N Mislav Marohnić
David N

Trying to resolve issues #535 (#535) and #452 (#452)

Mislav Marohnić
Collaborator

When does touch.js get loaded twice? Can't you prevent that in user code?

David N

There is no good reason for it to happen, I just saw the open issue and thought it would be an easy way to stop people from shooting themselves in the foot. I meant to make these as two separate pull requests though, sorry.

Mislav Marohnić
Collaborator

You don't have to make your contributions separate pull requests. Just make sure they're separate commits, like you did.

In the end I didn't use any of your commits, however. I didn't want to "patch" touch.js getting double-loaded until we decide that's an issue we want to fix, and your $.parseJSON commit was missing tests so I've just did the change myself: 236bd24

Mislav Marohnić mislav closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 26, 2012
  1. David N
  2. David N
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +2 −0  src/touch.js
  2. +2 −0  src/zepto.js
2  src/touch.js
View
@@ -3,6 +3,8 @@
// Zepto.js may be freely distributed under the MIT license.
;(function($){
+ if (window.Zepto.fn["swipe"]) return
+
var touch = {}, touchTimeout
function parentIfText(node){
2  src/zepto.js
View
@@ -199,6 +199,8 @@ var Zepto = (function() {
function funcArg(context, arg, idx, payload) {
return isFunction(arg) ? arg.call(context, idx, payload) : arg
}
+
+ $.parseJSON = JSON.parse
$.isFunction = isFunction
$.isObject = isObject
Something went wrong with that request. Please try again.