Commit 888ac97c by Braden MacDonald

Fix: Background Description was required but not always saved

parent cabfb810
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
.xblock--drag-and-drop--editor .items-form .item-image-url { .xblock--drag-and-drop--editor .items-form .item-image-url {
width: 81%; width: 81%;
margin-right: 1%; margin: 0 1%;
} }
.xblock--drag-and-drop--editor .items-form .item-width { .xblock--drag-and-drop--editor .items-form .item-width {
...@@ -224,7 +224,6 @@ ...@@ -224,7 +224,6 @@
border: 1px solid #156ab4; border: 1px solid #156ab4;
border-radius: 6px; border-radius: 6px;
padding: 5px 10px; padding: 5px 10px;
margin-top: 15px;
} }
.xblock--drag-and-drop--editor .btn:hover { .xblock--drag-and-drop--editor .btn:hover {
......
...@@ -181,13 +181,13 @@ function DragAndDropEditBlock(runtime, element, params) { ...@@ -181,13 +181,13 @@ function DragAndDropEditBlock(runtime, element, params) {
_fn.build.$el.targetImage.attr('src', new_img_url); _fn.build.$el.targetImage.attr('src', new_img_url);
} }
_fn.data.targetImg = new_img_url; _fn.data.targetImg = new_img_url;
})
.on('input', '.target-image-form #background-description', function(e) {
var new_description = $.trim( var new_description = $.trim(
$('.target-image-form #background-description', element).val() $('.target-image-form #background-description', element).val()
); );
_fn.build.$el.targetImage.attr('alt', new_description); _fn.build.$el.targetImage.attr('alt', new_description);
_fn.data.targetImgDescription = new_description; _fn.data.targetImgDescription = new_description;
}) })
.on('click', '.display-labels-form input', function(e) { .on('click', '.display-labels-form input', function(e) {
_fn.data.displayLabels = $('.display-labels-form input', element).is(':checked'); _fn.data.displayLabels = $('.display-labels-form input', element).is(':checked');
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<input id="background-url" <input id="background-url"
type="text" type="text"
placeholder="{% trans 'For example, http://example.com/background.png or /static/background.png' %}"> placeholder="{% trans 'For example, http://example.com/background.png or /static/background.png' %}">
<button class="btn">{% trans "Change background" %}</button>
<label class="h3" for="background-description">{% trans "Background description" %}</label> <label class="h3" for="background-description">{% trans "Background description" %}</label>
<textarea required id="background-description" <textarea required id="background-description"
aria-describedby="background-description-description"></textarea> aria-describedby="background-description-description"></textarea>
...@@ -62,7 +63,6 @@ ...@@ -62,7 +63,6 @@
to solve the problem even without seeing the image. to solve the problem even without seeing the image.
{% endblocktrans %} {% endblocktrans %}
</div> </div>
<button class="btn">{% trans "Change background" %}</button>
</form> </form>
</section> </section>
<section class="tab-content"> <section class="tab-content">
......
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