[ljcom] r11512: LJSUP-11099: LJ Shop. Change LJ Tokens m...
Committer: dpetrov
LJSUP-11099: LJ Shop. Change LJ Tokens mechanicsU 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-02-22 08:46:56 UTC (rev 11511)
+++ trunk/htdocs/js/jquery/jquery.lj.basicWidget.js 2012-02-22 09:08:51 UTC (rev 11512)
@@ -176,6 +176,38 @@
}
}
}
+ },
+
+ /**
+ * 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
+ */
+ _el: function(name) {
+ var method = '_' + name;
+
+ if (!this[method]) { this[method] = this.element.find(this.options.selectors[name]); };
+
+ return this[method];
+ },
+
+ /**
+ * Fetch the class name from the options.
+ *
+ * @param {string} name Name of the class name to search in this.options.classNames.
+ */
+ _cl: function(name) {
+ return this.options.classNames[name];
+ },
+
+ /**
+ * Fetch the selector from the options.
+ *
+ * @param {string} name Name of the selector to search in this.options.selectors
+ */
+ _s: function(name) {
+ return this.options.selectors[name];
}
} );
} )( jQuery );
