]> source.dussan.org Git - jquery-ui.git/commitdiff
Avoid IE memory leak on enableSelection, disableSelection methods.
authorEduardo Lundgren <eduardolundgren@gmail.com>
Fri, 27 Jun 2008 21:36:14 +0000 (21:36 +0000)
committerEduardo Lundgren <eduardolundgren@gmail.com>
Fri, 27 Jun 2008 21:36:14 +0000 (21:36 +0000)
ui/ui.core.js

index ff8dec8b4656ad2480b1d6d4830907e18c509a36..88596c446ab8496af5ecfad93a486818796b3df8 100644 (file)
@@ -46,15 +46,11 @@ $.ui = {
                try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){}
                return $.ui.cssCache[name];
        },
-       disableSelection: function(e) {
-               e.unselectable = "on";
-               e.onselectstart = function() { return false; };
-               if (e.style) { e.style.MozUserSelect = "none"; }
+       disableSelection: function(el) {
+               $(el).attr('unselectable', 'on').css('MozUserSelect', 'none');
        },
-       enableSelection: function(e) {
-               e.unselectable = "off";
-               e.onselectstart = function() { return true; };
-               if (e.style) { e.style.MozUserSelect = ""; }
+       enableSelection: function(el) {
+               $(el).attr('unselectable', 'off').css('MozUserSelect', '');
        },
        hasScroll: function(e, a) {
                var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;