Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#5798 closed bug (duplicate)

function disableSelection not correct(don`t work in all browsers)

Reported by: Ganster41 Owned by:
Priority: major Milestone:
Component: ui.core Version: 1.8.2
Keywords: disableSelection Cc:
Blocked by: Blocking:


Functions disable/enableSelection is not correct. It don`t work in webkit and IE. Correct code is:

    disableSelection : function() { 
            this.each(function() { 
                    this.onselectstart = function() { return false; }; 
                    this.unselectable = "on"; 
                    jQuery(this).css('-moz-user-select', 'none'); 
    enableSelection : function() { 
            this.each(function() { 
                    this.onselectstart = function() { }; 
                    this.unselectable = "off"; 
                    jQuery(this).css('-moz-user-select', 'auto'); 

Change History (4)

comment:1 Changed 13 years ago by Jörn Zaefferer

Currently we have this:

enableSelection: function() {
		return this
			.attr( "unselectable", "off" )
			.css( "MozUserSelect", "" );

	disableSelection: function() {
		return this
			.attr( "unselectable", "on" )
			.css( "MozUserSelect", "none" );

Need to verify where this actually doesn't work. The suggested code looks okay.

comment:2 Changed 13 years ago by Jörn Zaefferer

See also #5723.

comment:3 Changed 12 years ago by Scott González

Resolution: duplicate
Status: newclosed

comment:4 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.