Skip to content

Commit

Permalink
Retrieve hardcoded fields values from node data & remove them
Browse files Browse the repository at this point in the history
  • Loading branch information
beshrkayali committed Jan 21, 2020
1 parent 3c2e04d commit da8b653
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion djedi/static/djedi/plugins/img/js/img.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,16 @@ class window.ImageEditor extends window.Editor
@firstRender = false

updateForm: (data) ->

# Hardcoded fields
$("input[name='data[filename]']").val data.filename
$("input[name='data[crop]']").val ''
$("input[name='data[width]']").val data.width
$("input[name='data[height]']").val data.height
delete data.filename
delete data.width
delete data.height

# Form fields
for k, v of data
$("input[name='data[#{k}]']").val v

Expand Down
5 changes: 5 additions & 0 deletions djedi/static/djedi/plugins/img/js/img.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit da8b653

Please sign in to comment.