Committer: dpetrov
LJSUP-12135: Refactor userpicker widgetU trunk/htdocs/js/jquery/jquery.lj.basicWidget.js
Modified: trunk/htdocs/js/jquery/jquery.lj.basicWidget.js =================================================================== --- trunk/htdocs/js/jquery/jquery.lj.basicWidget.js 2012-06-22 13:06:39 UTC (rev 12162) +++ trunk/htdocs/js/jquery/jquery.lj.basicWidget.js 2012-06-22 15:46:29 UTC (rev 12163) @@ -184,13 +184,16 @@ * Find element inside the widget and return it. Note, that function caches the elements * and assigns them ti the widget object with the name _{name} * - * @param {string} name Name of the selector to search in this.options.selectors + * @param {string} name Name of the selector to search in this.options.selectors. + * @param {jQuery=} ctx Optionally we can say, where to find the node. */ - _el: function(name) { + _el: function(name, ctx) { var method = '_' + name; - if (!this[method]) { this[method] = this.element.find(this.options.selectors[name]); }; + ctx = ctx || this.element; + if (!this[method]) { this[method] = ctx.find(this.options.selectors[name]); }; + return this[method]; },