Author: jmorliaguet
Date: Tue Dec 20 17:09:09 2005
New Revision: 2064

Modified:
   cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.css
   cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js
Log:

- moved the hide / show tooltip function to the Preview class



Modified: 
cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.css
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.css    
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.css    
    Tue Dec 20 17:09:09 2005
@@ -12,7 +12,6 @@
   z-index: 1000;
   opacity: .8;
   filter: alpha(opacity=80);
-  visibility: hidden;
 }
 
 /* Message box */

Modified: 
cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js 
(original)
+++ cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js 
Tue Dec 20 17:09:09 2005
@@ -23,8 +23,8 @@
     Element.setStyle(widget_area, {'cursor': 'default'});
 
     // register the tooltip
-    Event.observe(widget_area, 'mousemove', show_tooltip);
-    Event.observe(widget_area, 'mouseout', hide_tooltip);
+    Event.observe(widget_area, 'mousemove', this.showTooltip.bind(this));
+    Event.observe(widget_area, 'mouseout', this.hideTooltip.bind(this));
 
     new Ajax.Updater(widget_area, 'renderPreview', {
       parameters: $H({widget_type: widget_type}).toQueryString(),
@@ -33,6 +33,23 @@
     Event.observe(widget_area, 'click', this.onClick.bind(this));
   },
 
+  showTooltip: function(e) {
+    if (!e) e = event;
+    var elem = Event.element(e);
+    var label = elem.getAttribute("label");
+    if (!label) {
+      label = 'unknown label';
+    }
+    replaceHTML(tooltip_box, label);
+    tooltip_box.style.left = '' + Event.pointerX(e) + "px";
+    tooltip_box.style.top = '' + Event.pointerY(e) + "px";
+    Element.show(tooltip_box);
+  },
+
+  hideTooltip: function() {
+    Element.hide(tooltip_box);
+  },
+
   onClick: function(e) {
     var elem = Event.element(e);
     // ignore inactive elements
@@ -205,25 +222,11 @@
   form_area = $('formArea');
   tooltip_box = $('tooltipBox');
 
-  preview = new Preview(widget_type);
-}
+  Element.hide(tooltip_box);
 
-function show_tooltip(e) {
-  if (!e) e = event;
-  var elem = Event.element(e);
-  var label = elem.getAttribute("label");
-  if (!label) {
-      label = 'unknown label';
-  }
-  replaceHTML(tooltip_box, label);
-  tooltip_box.style.visibility = "visible";
-  tooltip_box.style.left = '' + Event.pointerX(e) + "px";
-  tooltip_box.style.top = '' + Event.pointerY(e) + "px";
+  preview = new Preview(widget_type);
 }
 
-function hide_tooltip() {
-  tooltip_box.style.visibility = "hidden";
-}
 
 /* Debug */
 function write_message(msg) {
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to