Comparing version 1.12.1 to 1.12.2
@@ -83,3 +83,3 @@ define(["../has", "./config", "require", "module"], function(has, config, require, module){ | ||
var rev = "$Rev: a1e2d9d $".match(/[0-9a-f]{7,}/); | ||
var rev = "$Rev: 594ed6f $".match(/[0-9a-f]{7,}/); | ||
dojo.version = { | ||
@@ -97,3 +97,3 @@ // summary: | ||
major: 1, minor: 12, patch: 1, flag: "", | ||
major: 1, minor: 12, patch: 2, flag: "", | ||
revision: rev ? rev[0] : NaN, | ||
@@ -100,0 +100,0 @@ toString: function(){ |
define([ | ||
"../_base/array", "../_base/declare", "../_base/lang", | ||
"../dom", "../dom-class", "../Evented", "../on", "../topic", "../touch", "./common", "./Mover", "../_base/window" | ||
], function(array, declare, lang, dom, domClass, Evented, on, topic, touch, dnd, Mover, win){ | ||
"../_base/array", "../_base/declare", "../_base/lang", "../dom", "../dom-class", "../Evented", | ||
"../has", "../on", "../topic", "../touch", "./common", "./Mover", "../_base/window" | ||
], function(array, declare, lang, dom, domClass, Evented, has, on, topic, touch, dnd, Mover, win){ | ||
@@ -9,3 +9,23 @@ // module: | ||
var touchActionPropertyName; | ||
var setTouchAction = function () {}; | ||
function setTouchActionPropertyName() { | ||
if ("touchAction" in document.body.style) { | ||
touchActionPropertyName = "touchAction"; | ||
} | ||
else if ("msTouchAction" in document.body.style) { | ||
touchActionPropertyName = "msTouchAction"; | ||
} | ||
setTouchAction = function setTouchAction(/* Node */ node, /* string */ action) { | ||
node.style[touchActionPropertyName] = action; | ||
} | ||
setTouchAction(arguments[0], arguments[1]); | ||
} | ||
if (has("touch-action")) { | ||
// Ensure that the logic to determine "touchActionPropertyName" runs | ||
setTouchAction = setTouchActionPropertyName; | ||
} | ||
var Moveable = declare("dojo.dnd.Moveable", [Evented], { | ||
@@ -26,2 +46,3 @@ // summary: | ||
this.node = dom.byId(node); | ||
setTouchAction(this.node, "none"); | ||
if(!params){ params = {}; } | ||
@@ -51,2 +72,3 @@ this.handle = params.handle ? dom.byId(params.handle) : null; | ||
array.forEach(this.events, function(handle){ handle.remove(); }); | ||
setTouchAction(this.node, ""); | ||
this.events = this.node = this.handle = null; | ||
@@ -53,0 +75,0 @@ }, |
@@ -48,6 +48,8 @@ define(["./sniff", "./dom", "./_base/window"], function(has, dom, win){ | ||
getComputedStyle = function(node){ | ||
var dv = node.ownerDocument.defaultView, | ||
w = dv.opener ? dv : win.global.window.parent; | ||
return node.nodeType == 1 /* ELEMENT_NODE*/ ? | ||
w.getComputedStyle(node, null) : {}; | ||
if(node.nodeType === 1 /* ELEMENT_NODE*/){ | ||
var dv = node.ownerDocument.defaultView, | ||
w = dv.opener ? dv : win.global.window; | ||
return w.getComputedStyle(node, null); | ||
} | ||
return {}; | ||
}; | ||
@@ -54,0 +56,0 @@ } |
@@ -119,2 +119,6 @@ define(["require", "module"], function(require, module){ | ||
has.add("MSPointer", window.navigator.msPointerEnabled); | ||
// The "pointermove"" event is only continuously emitted in a touch environment if | ||
// the target node's "touch-action"" CSS property is set to "none" | ||
// https://www.w3.org/TR/pointerevents/#the-touch-action-css-property | ||
has.add("touch-action", has("touch") && has("pointer-events")); | ||
@@ -121,0 +125,0 @@ // I don't know if any of these tests are really correct, just a rough guess |
12
on.js
@@ -584,7 +584,9 @@ define(["./has!dom-addeventlistener?:./aspect", "./_base/kernel", "./sniff"], function(aspect, dojo, has){ | ||
} | ||
//use event.changedTouches[0].pageX|pageY|screenX|screenY|clientX|clientY|target | ||
var firstChangeTouch = event.changedTouches[0]; | ||
for(var i in firstChangeTouch){ // use for-in, we don't need to have dependency on dojo/_base/lang here | ||
delete event[i]; // delete it first to make it mutable | ||
event[i] = firstChangeTouch[i]; | ||
if (window.TouchEvent && originalEvent instanceof TouchEvent) { | ||
// use event.changedTouches[0].pageX|pageY|screenX|screenY|clientX|clientY|target | ||
var firstChangeTouch = event.changedTouches[0]; | ||
for(var i in firstChangeTouch){ // use for-in, we don't need to have dependency on dojo/_base/lang here | ||
delete event[i]; // delete it first to make it mutable | ||
event[i] = firstChangeTouch[i]; | ||
} | ||
} | ||
@@ -591,0 +593,0 @@ } |
{ | ||
"name": "dojo", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"directories": { | ||
@@ -14,3 +14,3 @@ "lib": "." | ||
"sinon": "1.12.2", | ||
"dojo": "1.12.1" | ||
"dojo": "1.12.2" | ||
}, | ||
@@ -17,0 +17,0 @@ "main": "main", |
@@ -9,4 +9,5 @@ define([ | ||
'../_base/lang', | ||
'../promise/Promise' | ||
], function(exports, RequestError, CancelError, Deferred, ioQuery, array, lang, Promise){ | ||
'../promise/Promise', | ||
'../has' | ||
], function(exports, RequestError, CancelError, Deferred, ioQuery, array, lang, Promise, has){ | ||
exports.deepCopy = function deepCopy(target, source){ | ||
@@ -125,3 +126,3 @@ for(var name in source){ | ||
if(data && !skipData){ | ||
if(typeof data === 'object' && !(data instanceof ArrayBuffer || data instanceof Blob )){ | ||
if(typeof data === 'object' && (!(has('native-xhr2')) || !(data instanceof ArrayBuffer || data instanceof Blob ))){ | ||
options.data = ioQuery.objectToQuery(data); | ||
@@ -128,0 +129,0 @@ } |
@@ -600,3 +600,9 @@ define([ | ||
}); | ||
// Since we can't simulate invoking TouchEvents (with current browsers initTouchEvent isn't available) | ||
// we will make TouchEvent be an Event temporarily so the `on` implementation | ||
// thinks that it is one for this test. | ||
var originalTouchEvent = window.TouchEvent; | ||
window.TouchEvent = Event; | ||
on.emit(div, 'touchstart', { changedTouches: [{ pageX: 100 }] }); | ||
window.TouchEvent = originalTouchEvent; | ||
@@ -606,2 +612,16 @@ assert.property(lastEvent, 'rotation'); | ||
}); | ||
has('touch') && (suite['DOM-specific']['touch event normalization doesn\'t happen to non-TouchEvent'] = function () { | ||
var div = document.body.appendChild(document.createElement('div')); | ||
var lastEvent; | ||
on(div, 'touchstart', function (event) { | ||
// Copying event properties to an object because certain versions of Firefox | ||
// threw insecure operation errors when saving an event to a closure-bound variable. | ||
lastEvent = lang.mixin({}, event); | ||
}); | ||
on.emit(div, 'touchstart', { changedTouches: [{ pageX: 100 }] }); | ||
assert.isFalse(lastEvent.pageX === 100); | ||
}); | ||
} | ||
@@ -608,0 +628,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4623581
137463