Changeset 547

Show
Ignore:
Timestamp:
08/15/08 17:25:09 (19 months ago)
Author:
scott.gonzalez
Message:

Core: Modified widget factory to prevent access to internal methods through the API (internal methods are any methods preceded by an underscore). Provides framework for #3188.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/ui.core.js

    r542 r547  
    3939                        args = Array.prototype.slice.call(arguments, 1); 
    4040                 
     41                // prevent calls to internal methods 
     42                if (isMethodCall && options.substring(0, 1) == '_') { 
     43                        return this; 
     44                } 
     45                 
     46                // handle getter methods 
    4147                if (isMethodCall && getter(namespace, name, options)) { 
    4248                        var instance = $.data(this[0], name); 
     
    4551                } 
    4652                 
     53                // handle initialization and non-getter methods 
    4754                return this.each(function() { 
    4855                        var instance = $.data(this, name);