web/data/cubicweb.htmlhelpers.js
branchstable
changeset 2338 3f7c7fbae94e
parent 2232 7837a3941327
child 2355 359903ef980a
--- a/web/data/cubicweb.htmlhelpers.js	Wed Jul 08 12:51:04 2009 +0200
+++ b/web/data/cubicweb.htmlhelpers.js	Wed Jul 08 13:58:37 2009 +0200
@@ -1,4 +1,5 @@
 CubicWeb.require('python.js');
+CubicWeb.require('jquery.corner.js');
 
 /* returns the document's baseURI. (baseuri() uses document.baseURI if
  * available and inspects the <base> tag manually otherwise.)
@@ -253,13 +254,25 @@
 }
 
 //============= page loading events ==========================================//
+
+CubicWeb.rounded = [
+		    ['div.sideBoxBody', 'bottom 6px'],
+		    ['div.boxTitle, div.boxPrefTitle, div.sideBoxTitle, th.month', 'top 6px'],
+		    ];
+
 function roundedCornersOnLoad() {
-    jQuery('div.sideBoxBody').corner('bottom 6px');
-    jQuery('div.boxTitle, div.boxPrefTitle, div.sideBoxTitle, th.month').corner('top 6px');
+    roundedCorners();
+}
+
+function roundedCorners(node) {
+    node == node || document.body;
+    node = jQuery(node);
+    for(var r=0; r<CubicWeb.rounded.length;r++){
+       node.find(CubicWeb.rounded[r][0]).corner(CubicWeb.rounded[r][1]);
+    }
 }
 
 jQuery(document).ready(roundedCornersOnLoad);
 
-
 CubicWeb.provide('htmlhelpers.js');