Author: jmorliaguet
Date: Tue May 23 23:40:21 2006
New Revision: 3205

Modified:
   cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
   
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualactions_test.html
   
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualmenu_test.html
   cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py

Log:

- UI fixes



Modified: cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    
(original)
+++ cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js    Tue May 
23 23:40:21 2006
@@ -956,6 +956,7 @@
 
     if (startDragX != null && startDragY != null) {
       if (Math.abs(startDragX-x) < 5 || Math.abs(startDragY-y) < 5) {
+        Event.stop(e);
         return false;
       } else {
         this.startDrag(x, y);
@@ -1079,7 +1080,10 @@
     }
 
     if (this.def.dragging.feedback && !zoomback && !zoomto) {
-      this.moved.parentNode.removeChild(this.moved);
+      var parent = this.moved.parentNode;
+      if (parent) {
+        parent.removeChild(this.moved);
+      }
     }
 
     this.moved.setStyle({cursor: ''});
@@ -2211,7 +2215,7 @@
 CPSSkins.ContextualMenu.prototype = Object.extend(new CPSSkins.View(), {
 
   setup: function() {
-    var showEvent = this.showEvent = this.showEvent.bindAsEventListener(this);
+    this.showEvent = this.showEvent.bindAsEventListener(this);
     this.hideEvent = this.hideEvent.bindAsEventListener(this);
     this.callEvent = this.callEvent.bindAsEventListener(this);
     this.mouseOverEvent = this.mouseOverEvent.bindAsEventListener(this);
@@ -2221,12 +2225,12 @@
     Event.observe(this.widget, "mouseover", this.mouseOverEvent);
     Event.observe(document, "mousedown", this.hideEvent);
 
-    $A(this.def.selectors || []).each(function(s) {
-      $$(s).each(function(el) {
-        Event.observe(el, "mouseup", showEvent);
-        el.oncontextmenu = function(e) { return false };
-      });
-    });
+    var area = this.def.area;
+    if (area) {
+      Event.observe(area, "mouseup", this.showEvent);
+      area.oncontextmenu = function(e) { return false };
+    }
+    this._displayed = false;
   },
 
   render: function(data) {
@@ -2392,7 +2396,6 @@
 
   /* Event handlers */
   showEvent: function(e) {
-    if (Event.isLeftClick(e)) return;
     var element = Event.element(e);
     var selected = CPSSkins.Identifiable.getIdentifiable(element);
     if (!selected) return;

Modified: 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualactions_test.html
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualactions_test.html
  (original)
+++ 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualactions_test.html
  Tue May 23 23:40:21 2006
@@ -28,12 +28,12 @@
 
   <h1>CPSSkins: Contextual actions</h1>
 
-  <div style="float: left; margin: 1em">
+  <div id="area" style="float: left; margin: 1em">
 
     <!-- View: contextual actions widget -->
     <ins class="view">
     {"id": "menu",
-     "selectors": ["div"],
+     "area": "area",
      "widget": {
        "type": "contextactions",
        "items": [

Modified: 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualmenu_test.html
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualmenu_test.html
     (original)
+++ 
cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/tests/functional/cpsskins_contextualmenu_test.html
     Tue May 23 23:40:21 2006
@@ -34,7 +34,7 @@
 
     <ins class="view">
     {"id": "menu",
-     "selectors": ["div"],
+     "area": "area",
      "widget": {
        "type": "contextmenu",
        "items": [

Modified: cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/authoring/definitions.py     Tue May 
23 23:40:21 2006
@@ -406,7 +406,7 @@
     # Contextual menu
     'context-menu': {
         'id': 'context-menu',
-        'selectors': ['#canvasArea div'],
+        'area': 'canvasArea',
         'perspectives': ['page-designer', 'layout-designer', 'content-author'],
         'controllers': ['menu-actions', 'main-editor-perspectives',
                         'show-hide-menu'],
@@ -507,7 +507,7 @@
             'offset_x': -5,
             'offset_y': -5,
             'feedback': {
-                'opacity': 0.8,
+                'opacity': 0.7,
             },
             'zoomback': {
                 'duration': 300,
@@ -528,19 +528,14 @@
         'dragging': {
             'source': 'elementMovable',
             'feedback': {
-                'opacity': 0.3,
+                'opacity': 0.7,
+                'clone': True,
             },
-            'zoomback': {
-                'duration': 300,
-            }
         },
         'shifting': {
             'element': 'elementShiftable',
         },
         'dropping': {
-            'highlight': {
-                'duration': 800,
-            },
             'action': 'move element',
         },
     },
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to