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,7 +241,11 @@ 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 () { var userDragProperty = L.DomUtil.testProp(
['userDrag', 'WebkitUserDrag', 'OUserDrag', 'MozUserDrag', 'msUserDrag']);
L.extend(L.DomUtil, {
disableTextSelection: function () {
if (userSelectProperty) { if (userSelectProperty) {
var style = document.documentElement.style; var style = document.documentElement.style;
this._userSelect = style[userSelectProperty]; this._userSelect = style[userSelectProperty];
@ -249,21 +253,18 @@ L.DomUtil.TRANSITION_END =
} else { } else {
L.DomEvent.on(window, 'selectstart', L.DomEvent.stop); L.DomEvent.on(window, 'selectstart', L.DomEvent.stop);
} }
}; },
L.DomUtil.enableTextSelection = function () { enableTextSelection: function () {
if (userSelectProperty) { if (userSelectProperty) {
document.documentElement.style[userSelectProperty] = this._userSelect; document.documentElement.style[userSelectProperty] = this._userSelect;
delete this._userSelect; delete this._userSelect;
} else { } else {
L.DomEvent.off(window, 'selectstart', L.DomEvent.stop); L.DomEvent.off(window, 'selectstart', L.DomEvent.stop);
} }
}; },
var userDragProperty = L.DomUtil.testProp( disableImageDrag: function () {
['userDrag', 'WebkitUserDrag', 'OUserDrag', 'MozUserDrag', 'msUserDrag']);
L.DomUtil.disableImageDrag = function () {
if (userDragProperty) { if (userDragProperty) {
var style = document.documentElement.style; var style = document.documentElement.style;
this._userDrag = style[userDragProperty]; this._userDrag = style[userDragProperty];
@ -271,14 +272,15 @@ L.DomUtil.TRANSITION_END =
} else { } else {
L.DomEvent.on(window, 'dragstart', L.DomEvent.stop); L.DomEvent.on(window, 'dragstart', L.DomEvent.stop);
} }
}; },
L.DomUtil.enableImageDrag = function () { enableImageDrag: function () {
if (userDragProperty) { if (userDragProperty) {
document.documentElement.style[userDragProperty] = this._userDrag; document.documentElement.style[userDragProperty] = this._userDrag;
delete this._userDrag; delete this._userDrag;
} else { } else {
L.DomEvent.off(window, 'dragstart', L.DomEvent.stop); L.DomEvent.off(window, 'dragstart', L.DomEvent.stop);
} }
}; }
});
})(); })();