Commit 541295cc by Braden MacDonald

Fix Studio editor when width/height data is absent

parent 2b7627e7
...@@ -321,16 +321,18 @@ function DragAndDropEditBlock(runtime, element, params) { ...@@ -321,16 +321,18 @@ function DragAndDropEditBlock(runtime, element, params) {
ctx.dropdown = _fn.build.form.createDropdown(ctx.zone); ctx.dropdown = _fn.build.form.createDropdown(ctx.zone);
// Item width/height are ignored, but preserve the data: // Item width/height are ignored in new versions of the block, but
if (!oldItem) ctx.width = '0'; // preserve the data in case we change back to using those values.
else ctx.width = oldItem.size.width.substr(0, if (oldItem && oldItem.size && oldItem.size.width != 'auto') {
oldItem.size.width.length - 2); ctx.width = oldItem.size.width.substr(0, oldItem.size.width.length - 2); // Remove 'px'
if (ctx.width == 'au') ctx.width = '0'; } else {
ctx.width = '0';
if (!oldItem) ctx.height = '0'; }
else ctx.height = oldItem.size.height.substr(0, if (oldItem && oldItem.size && oldItem.size.height != 'auto') {
oldItem.size.height.length - 2); ctx.height = oldItem.size.height.substr(0, oldItem.size.height.length - 2); // Remove 'px'
if (ctx.height == 'au') ctx.height = '0'; } else {
ctx.height = '0';
}
if (oldItem && oldItem.inputOptions) { if (oldItem && oldItem.inputOptions) {
ctx.numericalValue = oldItem.inputOptions.value; ctx.numericalValue = oldItem.inputOptions.value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment