]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from 1.7
authorvyshane <vyshane>
Wed, 15 Nov 2006 02:42:38 +0000 (02:42 +0000)
committervyshane <vyshane>
Wed, 15 Nov 2006 02:42:38 +0000 (02:42 +0000)
lib/ajax/block_classes.js
theme/standard/styles_layout.css

index 4292eb4e0b7a813061199d5e758cc21c6df074b3..55a76a27190659044eec4c994eea4e3c85e29525 100644 (file)
@@ -36,6 +36,9 @@ block_class.prototype.init_block = function(id, sGroup, config) {
     this.is = 'block';
     this.instanceId = this.getEl().id.replace(/inst/i, '');
 
+       // Add the drag class (move handle) only to blocks that need it.
+       YAHOO.util.Dom.addClass(this.getEl(), 'drag');
+
     this.addInvalidHandleType('a');
 
     var s = this.getEl().style;
@@ -97,6 +100,7 @@ block_class.prototype.endDrag = function() {
     this.resetTargets();
     }
 
+
 block_class.prototype.onDragDrop = function(e, id) {
     // get the drag and drop object that was targeted
     var oDD;
@@ -107,21 +111,19 @@ block_class.prototype.onDragDrop = function(e, id) {
         oDD = YAHOO.util.DDM.getBestMatch(id);
     }
 
-    
     var el = this.getEl();
-
-    YAHOO.log("id="+id+" el = "+e+" x="+YAHOO.util.Dom.getXY(this.getDragEl()));
     
+       if (this.debug) {
+               YAHOO.log("id="+id+" el="+e+" x="+YAHOO.util.Dom.getXY(this.getDragEl()));
+    }
     //var collisions = this.find_collisions(e,id);
 
     this.move_block(id);
     //YAHOO.util.DDM.moveToEl(el, oDD.getEl());
-
     
     this.resetTargets();
+}
 
-    }
 
 block_class.prototype.find_target = function(column){
         var collisions = column.find_sub_collision(YAHOO.util.Region.getRegion(this.getDragEl()));
@@ -261,12 +263,16 @@ block_class.prototype.delete_button = function() {
 }
 
 
+block_class.prototype.updatePosition = function(index, columnId) {
+       //update the db for the position
+    main.connectQueue_add('post', 'class=block&field=position', null,
+                       'value='+index+'&column='+columnId+'&instanceId='+this.instanceId);
+
+    if (this.debug) {
+               YAHOO.log("Updating position of "+this.getEl().id+" to index "+index+" on column "+columnId);
+       }
+}
 
-block_class.prototype.updatePosition = function(index,columnId){
-       //update the db for the position
-       main.connectQueue_add('post','class=block&field=position',null,'value='+index+'&column='+columnId+'&instanceId='+this.instanceId);
-       if(this.debug)YAHOO.log("updating position of "+this.getEl().id+" to index "+index+" on column "+columnId);               
-   }
 
 /*
  * column class, DD targets
index a42a3a9d9fb100214bc9bee30cc65b7afed7dbae..6efa39aedce828c2799ed8b1cdb640a7210bfb6a 100644 (file)
@@ -1201,7 +1201,7 @@ body#course-view .unread {
   margin-left: 3em;
 }
 
-body#course-view.drag .sideblock .header {
+body#course-view .drag.sideblock .header {
   cursor: move;
 }