From 7cac27f4e1c3484a9f5a5feb80f82c9fdb161815 Mon Sep 17 00:00:00 2001 From: Jamie Pratt Date: Fri, 19 Aug 2011 19:31:44 +0700 Subject: [PATCH] MDL-47494 ddimageortext: NOBUG issue with padding updating when uploading a new image in the same group. --- question/type/ddimageortext/dd.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/question/type/ddimageortext/dd.js b/question/type/ddimageortext/dd.js index 98bd969adb5..88a0dac7241 100644 --- a/question/type/ddimageortext/dd.js +++ b/question/type/ddimageortext/dd.js @@ -475,10 +475,10 @@ M.qtype_ddimagetoimage={ for (var i=0; i < this.form.get_form_value('noimages', []); i++) { //change to group selector - this.Y.all('fieldset#draggableimageheader_'+i+' select').on('change', function (e, i){ + this.Y.all('fieldset#draggableimageheader_'+i+' select').on('change', function (e){ this.doc.drag_images().remove(true); this.draw_dd_area(); - }, this, i); + }, this); //change to infinite checkbox this.Y.all('fieldset#draggableimageheader_'+i+' input[type="checkbox"]') .on('change', this.set_options_for_drag_image_selectors, this); @@ -487,8 +487,7 @@ M.qtype_ddimagetoimage={ this.Y.after(function (e){ var name = this.fp.name(e.id); if (name !== 'bgimage') { - var dragimageeno = this.form.from_name_with_index(name).indexes[0]; - this.doc.drag_images_cloned_from(dragimageeno).remove(true); + this.doc.drag_images().remove(true); } this.draw_dd_area(); }, M.form_filepicker, 'callback', this);