minor formatting stuff

This commit is contained in:
Vladimir Agafonkin 2013-06-25 10:25:16 -04:00
parent c3147e70db
commit e74fc2594e

View File

@ -241,44 +241,46 @@ L.DomUtil.TRANSITION_END =
var userSelectProperty = L.DomUtil.testProp( var userSelectProperty = L.DomUtil.testProp(
['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']); ['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);
L.DomUtil.disableTextSelection = function () {
if (userSelectProperty) {
var style = document.documentElement.style;
this._userSelect = style[userSelectProperty];
style[userSelectProperty] = 'none';
} else {
L.DomEvent.on(window, 'selectstart', L.DomEvent.stop);
}
};
L.DomUtil.enableTextSelection = function () {
if (userSelectProperty) {
document.documentElement.style[userSelectProperty] = this._userSelect;
delete this._userSelect;
} else {
L.DomEvent.off(window, 'selectstart', L.DomEvent.stop);
}
};
var userDragProperty = L.DomUtil.testProp( var userDragProperty = L.DomUtil.testProp(
['userDrag', 'WebkitUserDrag', 'OUserDrag', 'MozUserDrag', 'msUserDrag']); ['userDrag', 'WebkitUserDrag', 'OUserDrag', 'MozUserDrag', 'msUserDrag']);
L.DomUtil.disableImageDrag = function () { L.extend(L.DomUtil, {
if (userDragProperty) { disableTextSelection: function () {
var style = document.documentElement.style; if (userSelectProperty) {
this._userDrag = style[userDragProperty]; var style = document.documentElement.style;
style[userDragProperty] = 'none'; this._userSelect = style[userSelectProperty];
} else { style[userSelectProperty] = 'none';
L.DomEvent.on(window, 'dragstart', L.DomEvent.stop); } else {
} L.DomEvent.on(window, 'selectstart', L.DomEvent.stop);
}; }
},
L.DomUtil.enableImageDrag = function () { enableTextSelection: function () {
if (userDragProperty) { if (userSelectProperty) {
document.documentElement.style[userDragProperty] = this._userDrag; document.documentElement.style[userSelectProperty] = this._userSelect;
delete this._userDrag; delete this._userSelect;
} else { } else {
L.DomEvent.off(window, 'dragstart', L.DomEvent.stop); L.DomEvent.off(window, 'selectstart', L.DomEvent.stop);
}
},
disableImageDrag: function () {
if (userDragProperty) {
var style = document.documentElement.style;
this._userDrag = style[userDragProperty];
style[userDragProperty] = 'none';
} else {
L.DomEvent.on(window, 'dragstart', L.DomEvent.stop);
}
},
enableImageDrag: function () {
if (userDragProperty) {
document.documentElement.style[userDragProperty] = this._userDrag;
delete this._userDrag;
} else {
L.DomEvent.off(window, 'dragstart', L.DomEvent.stop);
}
} }
}; });
})(); })();