mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
19670e7b27
commit
c4e11804db
@ -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;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user