Unverified Commit 8809fd86 by Tyler Hallada Committed by GitHub

Merge pull request #16420 from edx/thallada/studio-outline-modal-escape

Allow escaping out of Studio CourseOutlineXBlockModals
parents 42396560 3665704a
...@@ -21,7 +21,8 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', ...@@ -21,7 +21,8 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
CourseOutlineXBlockModal = BaseModal.extend({ CourseOutlineXBlockModal = BaseModal.extend({
events: _.extend({}, BaseModal.prototype.events, { events: _.extend({}, BaseModal.prototype.events, {
'click .action-save': 'save' 'click .action-save': 'save',
keydown: 'keyHandler'
}), }),
options: $.extend({}, BaseModal.prototype.options, { options: $.extend({}, BaseModal.prototype.options, {
...@@ -102,6 +103,12 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', ...@@ -102,6 +103,12 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
}); });
return $.extend.apply(this, [true, {}].concat(requestData)); return $.extend.apply(this, [true, {}].concat(requestData));
},
keyHandler: function(event) {
if (event.which === 27) { // escape key
this.hide();
}
} }
}); });
......
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