Author: jmorliaguet
Date: Sun Jan  8 15:06:28 2006
New Revision: 2191

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
Log:

- moved the fadein effect of the contextual menu to the View API



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 Sun Jan  8 
15:06:28 2006
@@ -653,14 +653,14 @@
     var selected = Identifiable.getIdentifiable(element);
     if (!selected) return;
 
-    var x = Event.pointerX(e);
-    var y = Event.pointerY(e);
+    this.x = Event.pointerX(e);
+    this.y = Event.pointerY(e);
 
     var widget = this.widget;
 
     if (!this.active) {
       this.selected = selected;
-      this.show(x, y);
+      this.show();
       this.active = true;
     } else {
       this.active = false;
@@ -720,13 +720,13 @@
     return null;
   },
 
-  show: function(x, y) {
+  prepare: function() {
     var selected = this.selected;
     if (!selected) return;
 
     // Display the menu inside the screen
     var widget = this.widget;
-    Canvas.moveTo(widget, x, y);
+    Canvas.moveTo(widget, this.x, this.y);
     Canvas.fitInsideScreen(widget);
 
     // TODO: move this elsewhere
@@ -734,15 +734,6 @@
       CPSSkins.addObserver(selected, this);
     }
 
-    new CPSSkins.Scheduler(widget, {
-      action: function(value) {
-        Canvas.setOpacity(widget, value);
-        },
-      onComplete: function() {
-        Element.show(widget);
-      }
-    });
-
   },
 
   render: function(data) {
@@ -863,8 +854,7 @@
     }
   },
 
-  hide: function() {
-    Element.hide(this.widget);
+  teardown: function() {
     CPSSkins.removeObserver(this);
   }
 

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
  (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
  Sun Jan  8 15:06:28 2006
@@ -22,7 +22,8 @@
 
     <!-- View: contextual menu widget -->
 
-    <cpsskins:view widget="contextmenu" controller="controller">
+    <cpsskins:view widget="contextmenu" controller="controller"
+                   effects="fadein">
       <item label="Edit" icon="edit.png" action="edit"
             visible="editable"></item>
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to