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(
['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(
['userDrag', 'WebkitUserDrag', 'OUserDrag', 'MozUserDrag', 'msUserDrag']);
L.DomUtil.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);
}
};
L.extend(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.enableImageDrag = function () {
if (userDragProperty) {
document.documentElement.style[userDragProperty] = this._userDrag;
delete this._userDrag;
} else {
L.DomEvent.off(window, 'dragstart', L.DomEvent.stop);
enableTextSelection: function () {
if (userSelectProperty) {
document.documentElement.style[userSelectProperty] = this._userSelect;
delete this._userSelect;
} else {
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);
}
}
};
});
})();