Author: pyaschenko
Date: 2009-12-18 10:10:27 -0500 (Fri, 18 Dec 2009)
New Revision: 16170
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js
Log:
code review
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js 2009-12-18
12:52:58 UTC (rev 16169)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/toggler.js 2009-12-18
15:10:27 UTC (rev 16170)
@@ -1,3 +1,6 @@
+
+// TODO: remove second closure
+// TODO:
(function(jQuery, richfaces) {
richfaces.ui = richfaces.ui || {};
@@ -2,4 +5,5 @@
+ // TODO: Make "T" small. ToggleManager is not a class
richfaces.ui.ToggleManager = {};
-
+
(function(manager){
@@ -13,6 +17,7 @@
}
};
+ // TODO: Rename function names "clientToggle",
"serverToggle" ... May be one function "toggle" with additional
argument for type will be enough
manager['clientToggle'] = function(id, toState) {
if(id) {
togglers[id].clientToggle(toState);
@@ -46,8 +51,9 @@
(function (jQuery, richfaces) {
+ // TODO: not needed, was defined above
richfaces.ui = richfaces.ui || {};
-
+ // TODO: unnecessary space in tab
richfaces.ui.Toggle = function(id, options) {
this.getElement(id).rich= {component: this};
this.id = id;
@@ -62,12 +68,14 @@
jQuery.extend(richfaces.ui.Toggle.prototype, ( function () {
+ // REM: this=window. If you want to get this as instance to you object, you should
call this function from public function using call or apply and set as context your object
var convertId = function (id){
return id.replace(/:/g, "\\:");
};
return {
getElement : function (id) {
+ // TODO: use jQuery instead of $
return $("#" + convertId(id));
},
@@ -125,4 +133,4 @@
};
})());
-})(jQuery, window.RichFaces);
\ No newline at end of file
+})(jQuery, window.RichFaces); // TODO: RichFaces may be undefined
\ No newline at end of file
Show replies by date