Changeset 1434


Ignore:
Timestamp:
2010-02-09 16:08:49 (2 years ago)
Author:
freya
Message:

fix memory leak in options: attach event handlers to a jquery-wrapped object instead of empty <div> that is nowhere attached in the DOM tree

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/field.js

    r1297 r1434  
    165165    Options.prototype.$ = undefined; 
    166166     
    167     /** 
    168     * Lazy creation of the events handling element 
    169     * @return An html element (jQuery) 
    170     * @type jQuery 
    171     */ 
    172     Options.prototype.enableEvents = function() { 
    173  
    174         if (!this.$) { 
    175             this.$ = $("<div></div>").hide(); 
    176         } 
    177         return this.$; 
    178     } 
     167 
    179168    /**  
    180169    * Implemented "update" event 
     
    186175        if (!this.updateable()) return; 
    187176         
    188         var $ee = this.enableEvents(); 
    189         return (fn) ? $ee.bind("update", {options :this.values}, fn) : $ee.trigger("update"); 
     177        return (fn) ? $(this).bind("update", {options :this.values}, fn) : $(this).trigger("update"); 
    190178    } 
    191179     
Note: See TracChangeset for help on using the changeset viewer.