Commit eed09cc0 by Ehtesham Committed by Clinton Blackburn

CMS event fixes required to upgrade backbonejs

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