Commit c7858200 by Braden MacDonald

Don't preserve old size when saving changes; made it impossible to remove old fixed size

parent ce054355
...@@ -429,18 +429,12 @@ function DragAndDropEditBlock(runtime, element, params) { ...@@ -429,18 +429,12 @@ function DragAndDropEditBlock(runtime, element, params) {
correct: $el.find('.success-feedback').val(), correct: $el.find('.success-feedback').val(),
incorrect: $el.find('.error-feedback').val() incorrect: $el.find('.error-feedback').val()
}, },
size: {}, // old size data (preserved if present but ignored)
imageURL: imageURL, imageURL: imageURL,
imageDescription: imageDescription, imageDescription: imageDescription,
}; };
// Optional preferred width as a percentage of the bg image's width: // Optional preferred width as a percentage of the bg image's width:
var widthPercent = $el.find('.item-width').val(); var widthPercent = $el.find('.item-width').val();
if (widthPercent && +widthPercent > 0) { data.widthPercent = widthPercent; } if (widthPercent && +widthPercent > 0) { data.widthPercent = widthPercent; }
// Item width/height in pixels are now ignored, but preserve the data:
var width = $el.find('.item-pixel-width').val();
if (width && +width > 0) { data.size.width = (+width) + 'px'; }
var height = $el.find('.item-pixel-height').val();
if (height && +height > 0) { data.size.height = (+height) + 'px'; }
var numValue = parseFloat($el.find('.item-numerical-value').val()); var numValue = parseFloat($el.find('.item-numerical-value').val());
var numMargin = parseFloat($el.find('.item-numerical-margin').val()); var numMargin = parseFloat($el.find('.item-numerical-margin').val());
......
...@@ -98,12 +98,6 @@ ...@@ -98,12 +98,6 @@
<div class="row advanced"> <div class="row advanced">
<label for="item-{{id}}-width-percent">{{i18n "Preferred width as a percentage of the background image width (or blank for automatic width):"}}</label> <label for="item-{{id}}-width-percent">{{i18n "Preferred width as a percentage of the background image width (or blank for automatic width):"}}</label>
<input type="number" id="item-{{id}}-width-percent" class="item-width" value="{{ singleDecimalFloat widthPercent }}" step="0.1" min="1" max="99" />% <input type="number" id="item-{{id}}-width-percent" class="item-width" value="{{ singleDecimalFloat widthPercent }}" step="0.1" min="1" max="99" />%
<!--
A fixed pixel width/height is no longer used, so they are now hidden, but we are
preserving the existing data:
-->
<input type="hidden" class="item-pixel-width" value="{{ pixelWidth }}" />
<input type="hidden" class="item-pixel-height" value="{{ pixelHeight }}" />
</div> </div>
<div class="row advanced"> <div class="row advanced">
<label for="item-{{id}}-numerical-value"> <label for="item-{{id}}-numerical-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