mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
+20
-1
@@ -39,6 +39,23 @@ iD.behavior.drag = function() {
|
||||
};
|
||||
};
|
||||
|
||||
var d3_event_userSelectProperty = iD.util.prefixCSSProperty("UserSelect"),
|
||||
d3_event_userSelectSuppress = d3_event_userSelectProperty ?
|
||||
function () {
|
||||
var selection = d3.selection(),
|
||||
select = selection.style(d3_event_userSelectProperty);
|
||||
selection.style(d3_event_userSelectProperty, 'none');
|
||||
return function () {
|
||||
selection.style(d3_event_userSelectProperty, select);
|
||||
};
|
||||
} :
|
||||
function (type) {
|
||||
var w = d3.select(window).on("selectstart." + type, d3_eventCancel);
|
||||
return function () {
|
||||
w.on("selectstart." + type, null);
|
||||
};
|
||||
};
|
||||
|
||||
function mousedown() {
|
||||
target = this;
|
||||
event_ = event.of(target, arguments);
|
||||
@@ -46,7 +63,8 @@ iD.behavior.drag = function() {
|
||||
touchId = d3.event.touches ? d3.event.changedTouches[0].identifier : null,
|
||||
offset,
|
||||
origin_ = point(),
|
||||
moved = 0;
|
||||
moved = 0,
|
||||
selectEnable = d3_event_userSelectSuppress(touchId != null ? "drag-" + touchId : "drag");
|
||||
|
||||
var w = d3.select(window)
|
||||
.on(touchId !== null ? "touchmove.drag-" + touchId : "mousemove.drag", dragmove)
|
||||
@@ -103,6 +121,7 @@ iD.behavior.drag = function() {
|
||||
|
||||
w.on(touchId !== null ? "touchmove.drag-" + touchId : "mousemove.drag", null)
|
||||
.on(touchId !== null ? "touchend.drag-" + touchId : "mouseup.drag", null);
|
||||
selectEnable();
|
||||
}
|
||||
|
||||
function click() {
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ iD.util.prefixCSSProperty = function(property) {
|
||||
|
||||
while (++i < n)
|
||||
if (prefixes[i] + property in s)
|
||||
return '-' + prefixes[i].toLowerCase() + '-' + property.toLowerCase();
|
||||
return '-' + prefixes[i].toLowerCase() + property.replace(/([A-Z])/g, '-$1').toLowerCase();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user