Author: jmorliaguet
Date: Sat Dec 17 15:41:21 2005
New Revision: 2048

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

- using prototype's Element.hasClassName()



Modified: cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        Sat Dec 
17 15:41:21 2005
@@ -272,8 +272,7 @@
      if (el.getAttribute("destination") != drag_destination) return;
      }
 
-  var moving_class = moving.className
-  if (moving_class.indexOf('draggable') < 0) return;
+  if (!Element.hasClassName(moving, 'draggable')) return;
 
   if (!e) e = event;
   var speed = vertical_speed(e);
@@ -333,9 +332,9 @@
   if (!pd_selected_item) return;
   var moving = pd_selected_item;
   if (moving == el) return;
-  if (moving.className.indexOf('draggable') < 0) return;
+  if (!Element.hasClassName(moving, 'draggable')) return;
   var target = Event.element(e);
-  if (target.className.indexOf('container') < 0) return;
+  if (!Element.hasClassName(target, 'container')) return;
   if (!isNodeEmpty(target)) return;
   target.appendChild(moving);
   current_elem = moving;
@@ -461,8 +460,7 @@
 function setupEditable(mo) {
   mo.onmousedown = function(e) {
     var target = Event.element(e);
-    var className = target.className;
-    if (className.indexOf('editable') >= 0) return;
+    if (Element.hasClassName(target, 'editable')) return;
   }
   mo.onchange = function(e) {
     var target = Event.element(e);
@@ -471,8 +469,7 @@
   }
   mo.oncontextmenu = function(e) {
     var target = Event.element(e);
-    var className = target.className;
-    if (className.indexOf('editable') >= 0 || !moved) {
+    if (Element.hasClassName(target, 'editable') || !moved) {
       return pd_stopEvent(e);
     } else {
       highlight(mo);
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to