diff --git a/lib/ajax/block_classes.js b/lib/ajax/block_classes.js index 4292eb4e0b7..55a76a27190 100644 --- a/lib/ajax/block_classes.js +++ b/lib/ajax/block_classes.js @@ -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 diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index a42a3a9d9fb..6efa39aedce 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -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; }