Add test fixes and fix expand collapse behavior
Stop propagation of clicks in XBlockStringFieldEditor Fix collapsed subsections expanding when creating or deleting subsections Prevent clicking in display name textbox from toggling expand collapse Add test for published title when not live
This commit is contained in:
@@ -46,7 +46,7 @@ define(["jquery", "underscore", "js/views/xblock_outline", "js/views/utils/view_
|
||||
var expandedLocators = [];
|
||||
this.$('.outline-item.is-collapsible').each(function(index, rawElement) {
|
||||
var element = $(rawElement);
|
||||
if (!element.hasClass('collapsed')) {
|
||||
if (!element.hasClass('is-collapsed')) {
|
||||
expandedLocators.push(element.data('locator'));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@ define(["js/views/baseview", "js/views/utils/xblock_utils"],
|
||||
'click .xblock-field-value-edit': 'showInput',
|
||||
'click button[name=submit]': 'onClickSubmit',
|
||||
'click button[name=cancel]': 'onClickCancel',
|
||||
'click .xblock-string-field-editor': 'onClickEditor',
|
||||
'change .xblock-field-input': 'updateField',
|
||||
'focusout .xblock-field-input': 'onInputFocusLost',
|
||||
'keyup .xblock-field-input': 'handleKeyUp'
|
||||
@@ -54,14 +55,20 @@ define(["js/views/baseview", "js/views/utils/xblock_utils"],
|
||||
|
||||
onClickSubmit: function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.updateField();
|
||||
},
|
||||
|
||||
onClickCancel: function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.cancelInput();
|
||||
},
|
||||
|
||||
onClickEditor: function(event) {
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
onChangeField: function() {
|
||||
var value = this.model.get(this.fieldName);
|
||||
this.getLabel().text(value);
|
||||
@@ -72,6 +79,7 @@ define(["js/views/baseview", "js/views/utils/xblock_utils"],
|
||||
showInput: function(event) {
|
||||
var input = this.getInput();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.$el.addClass('is-editing');
|
||||
input.focus();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user