mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
Merged from 1.7
This commit is contained in:
parent
ced6ca158f
commit
7fdbbaea87
@ -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,22 +111,20 @@ block_class.prototype.onDragDrop = function(e, id) {
|
||||
oDD = YAHOO.util.DDM.getBestMatch(id);
|
||||
}
|
||||
|
||||
|
||||
var el = this.getEl();
|
||||
|
||||
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);
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user