CMS event fixes required to upgrade backbonejs
This commit is contained in:
@@ -26,7 +26,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview"],
|
||||
'click .action-cancel': 'cancel'
|
||||
},
|
||||
|
||||
options: $.extend({}, BaseView.prototype.options, {
|
||||
options: _.extend({}, BaseView.prototype.options, {
|
||||
type: 'prompt',
|
||||
closeIcon: false,
|
||||
icon: false,
|
||||
|
||||
@@ -17,9 +17,9 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
VerificationAccessEditor, TimedExaminationPreferenceEditor, AccessEditor;
|
||||
|
||||
CourseOutlineXBlockModal = BaseModal.extend({
|
||||
events : {
|
||||
events : _.extend({}, BaseModal.prototype.events, {
|
||||
'click .action-save': 'save'
|
||||
},
|
||||
}),
|
||||
|
||||
options: $.extend({}, BaseModal.prototype.options, {
|
||||
modalName: 'course-outline',
|
||||
@@ -32,7 +32,6 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
|
||||
initialize: function() {
|
||||
BaseModal.prototype.initialize.call(this);
|
||||
this.events = $.extend({}, BaseModal.prototype.events, this.events);
|
||||
this.template = this.loadTemplate('course-outline-modal');
|
||||
this.options.title = this.getTitle();
|
||||
},
|
||||
@@ -154,10 +153,10 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
}
|
||||
},
|
||||
|
||||
events: {
|
||||
events: _.extend({}, CourseOutlineXBlockModal.prototype.events, {
|
||||
'click .action-save': 'save',
|
||||
'click .settings-tab-button': 'handleShowTab',
|
||||
},
|
||||
'click .settings-tab-button': 'handleShowTab'
|
||||
}),
|
||||
|
||||
/**
|
||||
* Return request data.
|
||||
@@ -185,9 +184,9 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
|
||||
|
||||
PublishXBlockModal = CourseOutlineXBlockModal.extend({
|
||||
events : {
|
||||
events : _.extend({}, CourseOutlineXBlockModal.prototype.events, {
|
||||
'click .action-publish': 'save'
|
||||
},
|
||||
}),
|
||||
|
||||
initialize: function() {
|
||||
CourseOutlineXBlockModal.prototype.initialize.call(this);
|
||||
|
||||
@@ -9,10 +9,10 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "common
|
||||
"strict mode";
|
||||
|
||||
var EditXBlockModal = BaseModal.extend({
|
||||
events : {
|
||||
events: _.extend({}, BaseModal.prototype.events, {
|
||||
"click .action-save": "save",
|
||||
"click .action-modes a": "changeMode"
|
||||
},
|
||||
}),
|
||||
|
||||
options: $.extend({}, BaseModal.prototype.options, {
|
||||
modalName: 'edit-xblock',
|
||||
@@ -25,7 +25,6 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "common
|
||||
|
||||
initialize: function() {
|
||||
BaseModal.prototype.initialize.call(this);
|
||||
this.events = _.extend({}, BaseModal.prototype.events, this.events);
|
||||
this.template = this.loadTemplate('edit-xblock-modal');
|
||||
this.editorModeButtonTemplate = this.loadTemplate('editor-mode-button');
|
||||
},
|
||||
|
||||
@@ -38,7 +38,7 @@ define(['jquery', 'underscore', 'gettext', 'js/views/modals/base_modal'],
|
||||
|
||||
return this.template({
|
||||
response: this.response,
|
||||
num_errors: this.response.length,
|
||||
num_errors: this.response.length
|
||||
});
|
||||
},
|
||||
|
||||
@@ -57,7 +57,7 @@ define(['jquery', 'underscore', 'gettext', 'js/views/modals/base_modal'],
|
||||
|
||||
// hide the modal
|
||||
BaseModal.prototype.hide.call(this);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
return ValidationErrorModal;
|
||||
|
||||
@@ -6,12 +6,14 @@ define(["jquery", "underscore", "gettext", "js/views/pages/container", "js/views
|
||||
'use strict';
|
||||
var PagedXBlockContainerPage = XBlockContainerPage.extend({
|
||||
|
||||
events: {"click .toggle-preview-button": "toggleChildrenPreviews"},
|
||||
events: _.extend({}, XBlockContainerPage.prototype.events, {
|
||||
'click .toggle-preview-button': 'toggleChildrenPreviews'
|
||||
}),
|
||||
|
||||
defaultViewClass: PagedContainerView,
|
||||
components_on_init: false,
|
||||
|
||||
initialize: function (options){
|
||||
this.events = _.extend({}, XBlockContainerPage.prototype.events, this.events);
|
||||
initialize: function (options) {
|
||||
this.page_size = options.page_size || 10;
|
||||
this.showChildrenPreviews = options.showChildrenPreviews || true;
|
||||
XBlockContainerPage.prototype.initialize.call(this, options);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "jquery.form"],
|
||||
function($, _, gettext, BaseModal) {
|
||||
var UploadDialog = BaseModal.extend({
|
||||
events: {
|
||||
events: _.extend({}, BaseModal.prototype.events, {
|
||||
"change input[type=file]": "selectFile",
|
||||
"click .action-upload": "upload"
|
||||
},
|
||||
}),
|
||||
|
||||
options: $.extend({}, BaseModal.prototype.options, {
|
||||
modalName: 'assetupload',
|
||||
@@ -15,7 +15,6 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "jquery
|
||||
|
||||
initialize: function() {
|
||||
BaseModal.prototype.initialize.call(this);
|
||||
this.events = _.extend({}, BaseModal.prototype.events, this.events);
|
||||
this.template = this.loadTemplate("upload-dialog");
|
||||
this.listenTo(this.model, "change", this.renderContents);
|
||||
this.options.title = this.model.get('title');
|
||||
|
||||
Reference in New Issue
Block a user