BUGFIX: Prevent text-selection during drag operation, Firefox-specific

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@95511 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Luke Hudson 2009-12-16 01:24:47 +00:00 committed by Sam Minnee
parent 19670e7b27
commit c4e11804db

View File

@ -26,6 +26,10 @@ DraggableSeparator.prototype = {
document.onmousemove = this.document_mousemove.bindAsEventListener(this);
document.onmouseup = this.document_mouseup.bindAsEventListener(this);
// MozUserSelect='none' prevents text-selection during drag, in firefox.
Element.setStyle($('right'), {MozUserSelect: 'none'});
Element.setStyle($('left'), {MozUserSelect: 'none'});
// onselectstart captured to prevent text-selection in IE
document.body.onselectstart = this.body_selectstart.bindAsEventListener(this);
},
document_mousemove : function(event) {
@ -33,6 +37,9 @@ DraggableSeparator.prototype = {
fixRightWidth();
},
document_mouseup : function(e) {
// MozUserSelect='' re-enables text-selection in firefox.
Element.setStyle($('right'), {MozUserSelect: ''});
Element.setStyle($('left'), {MozUserSelect: ''});
document.onmousemove = null;
},