Author: jmorliaguet
Date: Sat Jan  7 13:47:32 2006
New Revision: 2176

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- made the tooltip implement View interface



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sat Jan  7 
13:47:32 2006
@@ -799,7 +799,7 @@
 
 // Tooltip
 CPSSkins.Tooltip = Class.create();
-CPSSkins.Tooltip.prototype = {
+CPSSkins.Tooltip.prototype = Object.extend(new CPSSkins.View(), {
 
   initialize: function(widget, tag) {
     this.widget = widget;
@@ -817,15 +817,26 @@
     Event.observe(this.area || document, "mouseout", this.hideEvent);
   },
 
-  showEvent: function(e) {
-    var selected = Event.element(e);
+  getData: function() {
+    var selected = this.selected;
+    if (!selected) return selected;
     var data = Canvas.getNodeData(selected);
+    return data;
+  },
+
+  render: function(data) {
     if (!data) return;
+    this.widget.innerHTML = data.hint;
+  },
+
+  showEvent: function(e) {
+    this.selected = Event.element(e);
 
     var widget = this.widget;
     widget.style.top = Event.pointerY(e) + 20 + "px";
     widget.style.left = Event.pointerX(e) + "px";
-    widget.innerHTML = data["hint"]
+
+    this.update();
 
     if (this.effect) {
       this.effect.stop();
@@ -842,7 +853,6 @@
       }
     });
 
-    this.selected = selected;
   },
 
   hideEvent: function(e) {
@@ -872,5 +882,5 @@
 
   }
 
-}
+});
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to