update data-mce-src on existing images in rce

fix a bug where the rce image plugin would update src but not
data-mce-src on existing images causing it to revert back to the
previous image on save.

closes CORE-843

test plan:
- add an image in an rce
- select the image
- click the Embed Image button in the toolbar
- change it to a different image and click Update
- save the wiki page
- it should show image you change it to instead of the first image

Change-Id: I5da3d0affc8074296e10a1872ac0fd45c6d8372c
Reviewed-on: https://gerrit.instructure.com/140896
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
This commit is contained in:
Brent Burgoyne 2018-02-13 22:51:34 -07:00
parent 72c07fe5d5
commit 264d4f46c4
2 changed files with 2 additions and 0 deletions

View File

@ -145,6 +145,7 @@ define [
if @$("[name='image[data-decorative]']").is(':checked')
res['alt'] = ''
res['data-decorative'] = true
res['data-mce-src'] = res.src
res
onFileLinkClick: (event) ->

View File

@ -63,6 +63,7 @@ define [
equal(img.attr('width'), "400")
equal(img.attr('height'), "300")
equal(img.attr('src'), "testsrc")
equal(img.attr('data-mce-src'), "testsrc")
equal(img.attr('alt'), "testalt")
test "it updates decorative attributes for existing images", ->