Author: jmorliaguet
Date: Sun May 28 00:03:23 2006
New Revision: 3257

Modified:
   cpsskins/branches/paris-sprint-2006/lib/cpsskins/src/cpsskins.js
   cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
   cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py

Log:

- fixed the 'delete element' / 'duplicate element' menu handlers



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    Sun May 
28 00:03:23 2006
@@ -508,6 +508,7 @@
       // add some contextual info
       event.view = view;
       event.model = view.model;
+      event.controller = controller;
 
       var action = event.options.action;
       /* the event handler calls the controller's registered handler */
@@ -1041,7 +1042,7 @@
         if (action_handler) action_handler({
           source: dragged,
           target: this.droptarget || this.target,
-          context: this
+          controller: this
         });
       }
     }

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/common/authoring.js  Sun May 
28 00:03:23 2006
@@ -25,23 +25,23 @@
   }
   var options = {
     parameters: $H(args).toQueryString(),
-    onComplete: function(req) {
-      var controller = info.context;
-      controller.refreshViews();
-    }
+    onComplete: function(req) {info.controller.refreshViews();}
   };
   new Ajax.Request(url, options);
 }
 
 function moveElement(info) {
-  var url = '@@moveElement'
+  var url = '@@moveElement';
+  var id = info.target.getAttribute('id');
+  var model = CPSSkins.getModelById('m' + id);
   var args = {
     src_id: info.source.getAttribute('id'),
-    dest_id: info.target.getAttribute('id'),
-    order: 0
+    dest_id: id,
+    order: model.order
   }
   var options = {
-    parameters: $H(args).toQueryString()
+    parameters: $H(args).toQueryString(),
+    onComplete: function(req) {info.controller.refreshViews();}
   };
   new Ajax.Request(url, options);
 }
@@ -65,10 +65,7 @@
   }
   var options = {
     parameters: $H(args).toQueryString(),
-    onComplete: function(req) {
-      var controller = info.context;
-      controller.refreshViews();
-    }
+    onComplete: function(req) {info.controller.refreshViews();}
   }
   new Ajax.Request(url, options);
 }
@@ -80,10 +77,7 @@
   }
   var options = {
     parameters: $H(args).toQueryString(),
-    onComplete: function(req) {
-      var controller = info.context;
-      controller.refreshViews();
-    }
+    onComplete: function(req) {info.controller.refreshViews();}
   }
   new Ajax.Request(url, options);
 }
@@ -100,6 +94,7 @@
   'insert portlet': insertPortlet,
   'move element': moveElement,
   'duplicate element': duplicateElement,
+  'delete element': deleteElement,
   'edit element': editElement,
   'cancel event': function(e) {Event.stop(e); return false;}
 });

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       Sun May 
28 00:03:23 2006
@@ -341,7 +341,8 @@
         'perspectives': ['wysiwyg'],
         'controllers': ['main-editor-perspectives', 'disable-links',
                         'page-mode-perspectives', 'element-mover',
-                        'portlet-factory', 'main-editor-actions'],
+                        'portlet-factory', 'main-editor-actions',
+                        'menu-actions'],
     },
 
     'layout-mode': {
@@ -353,7 +354,8 @@
         'perspectives': ['layout'],
         'controllers': ['main-editor-perspectives', 'disable-links',
                         'page-mode-perspectives', 'element-mover',
-                        'portlet-factory', 'main-editor-actions'],
+                        'portlet-factory', 'main-editor-actions',
+                        'menu-actions'],
     },
 
     # the content author screen
@@ -365,7 +367,7 @@
         'model': 'content-author',
         'perspectives': ['content-author'],
         'controllers': ['main-editor-perspectives', 'element-mover',
-                        'portlet-factory', 'disable-links'],
+                        'portlet-factory', 'disable-links', 'menu-actions']
     },
 
     # the site manager screen
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to