Commit 74a0e79a by Braden MacDonald

Hide width/height fields in Studio but keep existing data.

parent e8708605
...@@ -330,7 +330,8 @@ function DragAndDropEditBlock(runtime, element, params) { ...@@ -330,7 +330,8 @@ function DragAndDropEditBlock(runtime, element, params) {
ctx.dropdown = _fn.build.form.createDropdown(ctx.zone); ctx.dropdown = _fn.build.form.createDropdown(ctx.zone);
if (!oldItem) ctx.width = '190'; // Item width/height are ignored, but preserve the data:
if (!oldItem) ctx.width = '0';
else ctx.width = oldItem.size.width.substr(0, else ctx.width = oldItem.size.width.substr(0,
oldItem.size.width.length - 2); oldItem.size.width.length - 2);
if (ctx.width == 'au') ctx.width = '0'; if (ctx.width == 'au') ctx.width = '0';
...@@ -385,6 +386,7 @@ function DragAndDropEditBlock(runtime, element, params) { ...@@ -385,6 +386,7 @@ function DragAndDropEditBlock(runtime, element, params) {
backgroundImage = $el.find('.background-image').val(); backgroundImage = $el.find('.background-image').val();
if (name.length > 0 || backgroundImage.length > 0) { if (name.length > 0 || backgroundImage.length > 0) {
// Item width/height are ignored, but preserve the data:
var width = $el.find('.item-width').val(), var width = $el.find('.item-width').val(),
height = $el.find('.item-height').val(); height = $el.find('.item-height').val();
......
...@@ -56,7 +56,15 @@ ...@@ -56,7 +56,15 @@
<label>{{i18n "Error Feedback"}}</label> <label>{{i18n "Error Feedback"}}</label>
<textarea class="error-feedback">{{ feedback.incorrect }}</textarea> <textarea class="error-feedback">{{ feedback.incorrect }}</textarea>
</div> </div>
<div class="row"> <div class="row" style="display: none;">
<!--
width and height are no longer respected, so they are now hidden, but we are
keeping the HTML and JS code intact so that the existing data will be preserved
until we can be sure that removing the width/height is OK for all courses that use
this block.
If we do add them back in, we should only allow setting "width". Height will be
detected automatically based on font/image size requirements.
-->
<label>{{i18n "Width in pixels (0 for auto)"}}</label> <label>{{i18n "Width in pixels (0 for auto)"}}</label>
<input type="text" class="item-width" value="{{ width }}"></input> <input type="text" class="item-width" value="{{ width }}"></input>
<label>{{i18n "Height in pixels (0 for auto)"}}</label> <label>{{i18n "Height in pixels (0 for auto)"}}</label>
......
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