Commit 0e723306 by E. Kolpakov

Overlay-style spinner for items with images

parent 7fb5cfc9
......@@ -85,6 +85,22 @@
float: left;
}
.xblock--drag-and-drop .drag-container .option.option-with-image .spinner-wrapper {
position: absolute;
float: none;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: #000;
opacity: 0.6;
color: #fff;
margin: 0;
display: flex;
justify-content: center; /* align horizontal */
align-items: center; /* align vertical */
}
.xblock--drag-and-drop .drag-container .option .item-content {
display: inline-block;
}
......
......@@ -316,7 +316,8 @@ function DragAndDropBlock(runtime, element, configuration) {
class_name: item_user_state && ('input' in item_user_state || item_user_state.correct_input) ? 'fade': undefined,
xhr_active: (item_user_state && item_user_state.submitting_location),
input: input,
content_html: item.backgroundImage ? '<img src="' + item.backgroundImage + '"/>' : item.displayName
content_html: item.backgroundImage ? '<img src="' + item.backgroundImage + '"/>' : item.displayName,
has_image: !!item.backgroundImage
};
if (item_user_state) {
itemProperties.is_placed = true;
......
......@@ -54,6 +54,7 @@
var itemTemplate = function(item) {
var style = {};
var className = (item.class_name) ? item.class_name : "";
if (item.background_color) {
style['background-color'] = item.background_color;
}
......@@ -64,11 +65,14 @@
style.left = item.x_percent + "%";
style.top = item.y_percent + "%";
}
if (item.has_image) {
className += " " + "option-with-image";
}
return (
h('div.option',
{
key: item.value,
className: item.class_name,
className: className,
attributes: {'data-value': item.value, 'data-drag-disabled': item.drag_disabled},
style: style
}, [
......
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