]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from 1.7.
authorvyshane <vyshane>
Fri, 17 Nov 2006 02:58:56 +0000 (02:58 +0000)
committervyshane <vyshane>
Fri, 17 Nov 2006 02:58:56 +0000 (02:58 +0000)
lib/ajax/block_classes.js

index a94aae48c8bcfbb1efb87482492638762ee68813..69fb703d4ff477ecc4d7b87a1bca57c4c64efcc9 100644 (file)
@@ -243,18 +243,20 @@ block_class.prototype.toggle_hide = function(e, target, isCosmetic) {
 
 
 block_class.prototype.delete_button = function() {
-
-       //remove from local model
+       // Remove from local model.
     if (main.rightcolumn.has_block(this)) {
        main.rightcolumn.remove_block(this);
     } else if (main.leftcolumn.has_block(this)) {
         main.leftcolumn.remove_block(this);
        }
-    //remove from remote model
-    main.connect('DELETE','class=block&instanceId='+this.instanceId);
+       // Remove block from the drag and drop group in YUI.
+       this.removeFromGroup('blocks');
+
+    // Remove from remote model.
+    main.connect('DELETE', 'class=block&instanceId='+this.instanceId);
         
-    //remove from view
-    main.blocks[main.get_block_index(this)] = null;
+    // Remove from view
+       main.blocks.splice(main.get_block_index(this), 1);
     this.getEl().parentNode.removeChild(this.getEl());
 
        if (this.debug) {