[Rt-commit] rt branch, no-prototype, updated. rt-3.8.8-198-g8c64a27

? sunnavy sunnavy at bestpractical.com
Tue Aug 3 02:28:22 EDT 2010


The branch, no-prototype has been updated
       via  8c64a27fe17313bd5902ddc789677f0e445ed625 (commit)
       via  68311ad5074f54ffd8cec3594e8b1979ca54f7dd (commit)
      from  73a10d7f3987878c461281c61c037067f8cd3123 (commit)

Summary of changes:
 share/html/NoAuth/js/util.js |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 68311ad5074f54ffd8cec3594e8b1979ca54f7dd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Aug 3 14:20:40 2010 +0800

    add doOnLoad() for back compatibility

diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index eb576cf..770b8cf 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -207,3 +207,8 @@ function ahah( url, id ) {
     jQuery('#'+id).load(url);
 }
 
+// only for back compatibility, please JQuery() instead
+function doOnLoad( js ) {
+    jQuery(js);
+}
+

commit 8c64a27fe17313bd5902ddc789677f0e445ed625
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Aug 3 14:29:58 2010 +0800

    add jQueryWrap help function so we can get jquery object via dom element or id

diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index 770b8cf..88e1b0f 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -79,21 +79,22 @@ function switchVisibility(id1, id2) {
 }
 
 /* Classes */
+function jQueryWrap( id ) {
+    return typeof id == 'object' ? jQuery(id) : jQuery('#'+id);
+}
 
 function addClass(id, value) {
-    var e = typeof id == 'object' ? jQuery(id) : jQuery('#'+id);
-    e.addClass(value);
+    jQueryWrap(id).addClass(value);
 }
 
 function delClass(id, value) {
-    var e = typeof id == 'object' ? jQuery(id) : jQuery('#'+id);
-    e.removeClass(value);
+    jQueryWrap(id).removeClass(value);
 }
 
 /* Rollups */
 
 function rollup(id) {
-    var e = typeof id == 'object' ? jQuery(id) : jQuery('#'+id);
+    var e = jQueryWrap(id);
     var e2  = e.parent();
     
     if (e.hasClass('hidden')) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list