Skip to main content

Search and Top Navigation

#5798 closed bug (duplicate)

Opened July 06, 2010 07:36AM UTC

Closed August 23, 2010 06:14PM UTC

Last modified October 11, 2012 09:15PM UTC

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:
Description

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'); 
            }); 
    }
Attachments (0)
Change History (4)

Changed July 30, 2010 10:52AM UTC by jzaefferer comment:1

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.

Changed July 30, 2010 11:47AM UTC by jzaefferer comment:2

See also #5723.

Changed August 23, 2010 06:14PM UTC by scottgonzalez comment:3

resolution: → duplicate
status: newclosed

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:4

milestone: TBD

Milestone TBD deleted