can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r12163: LJSUP-12135: Refactor userpicker widget

Committer: dpetrov
LJSUP-12135: Refactor userpicker widget
U   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];
 		},
 

Tags: can3p, dpetrov, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments