Commit 8b13ff3d by Peter Fogg

Merge pull request #376 from edx/peter-fogg/rename-notification-save

Rename CMS.Views.Notification.Saving to Mini.
parents 5b4524d7 9c8f6372
...@@ -102,9 +102,9 @@ describe "CMS.Views.Prompt", -> ...@@ -102,9 +102,9 @@ describe "CMS.Views.Prompt", ->
view.hide() view.hide()
# expect($("body")).not.toHaveClass("prompt-is-shown") # expect($("body")).not.toHaveClass("prompt-is-shown")
describe "CMS.Views.Notification.Saving", -> describe "CMS.Views.Notification.Mini", ->
beforeEach -> beforeEach ->
@view = new CMS.Views.Notification.Saving() @view = new CMS.Views.Notification.Mini()
it "should have minShown set to 1250 by default", -> it "should have minShown set to 1250 by default", ->
expect(@view.options.minShown).toEqual(1250) expect(@view.options.minShown).toEqual(1250)
......
...@@ -43,7 +43,7 @@ describe "Course Overview", -> ...@@ -43,7 +43,7 @@ describe "Course Overview", ->
spyOn(window, 'saveSetSectionScheduleDate').andCallThrough() spyOn(window, 'saveSetSectionScheduleDate').andCallThrough()
# Have to do this here, as it normally gets bound in document.ready() # Have to do this here, as it normally gets bound in document.ready()
$('a.save-button').click(saveSetSectionScheduleDate) $('a.save-button').click(saveSetSectionScheduleDate)
@notificationSpy = spyOn(CMS.Views.Notification.Saving.prototype, 'show').andCallThrough() @notificationSpy = spyOn(CMS.Views.Notification.Mini.prototype, 'show').andCallThrough()
window.analytics = jasmine.createSpyObj('analytics', ['track']) window.analytics = jasmine.createSpyObj('analytics', ['track'])
window.course_location_analytics = jasmine.createSpy() window.course_location_analytics = jasmine.createSpy()
sinon.useFakeXMLHttpRequest() sinon.useFakeXMLHttpRequest()
......
...@@ -73,7 +73,7 @@ describe "CMS.Views.ShowTextbook", -> ...@@ -73,7 +73,7 @@ describe "CMS.Views.ShowTextbook", ->
@xhr = sinon.useFakeXMLHttpRequest() @xhr = sinon.useFakeXMLHttpRequest()
@xhr.onCreate = (xhr) -> requests.push(xhr) @xhr.onCreate = (xhr) -> requests.push(xhr)
@savingSpies = spyOnConstructor(CMS.Views.Notification, "Saving", @savingSpies = spyOnConstructor(CMS.Views.Notification, "Mini",
["show", "hide"]) ["show", "hide"])
@savingSpies.show.andReturn(@savingSpies) @savingSpies.show.andReturn(@savingSpies)
......
...@@ -712,7 +712,7 @@ function saveSetSectionScheduleDate(e) { ...@@ -712,7 +712,7 @@ function saveSetSectionScheduleDate(e) {
'start': start 'start': start
}); });
var saving = new CMS.Views.Notification.Saving({ var saving = new CMS.Views.Notification.Mini({
title: gettext("Saving") + "…", title: gettext("Saving") + "…",
}); });
saving.show(); saving.show();
......
...@@ -22,7 +22,7 @@ CMS.Models.Section = Backbone.Model.extend({ ...@@ -22,7 +22,7 @@ CMS.Models.Section = Backbone.Model.extend({
}, },
showNotification: function() { showNotification: function() {
if(!this.msg) { if(!this.msg) {
this.msg = new CMS.Views.Notification.Saving({ this.msg = new CMS.Views.Notification.Mini({
title: gettext("Saving") + "…" title: gettext("Saving") + "…"
}); });
} }
......
...@@ -185,7 +185,7 @@ CMS.Views.Prompt = CMS.Views.SystemFeedback.extend({ ...@@ -185,7 +185,7 @@ CMS.Views.Prompt = CMS.Views.SystemFeedback.extend({
var capitalCamel, types, intents; var capitalCamel, types, intents;
capitalCamel = _.compose(_.str.capitalize, _.str.camelize); capitalCamel = _.compose(_.str.capitalize, _.str.camelize);
types = ["alert", "notification", "prompt"]; types = ["alert", "notification", "prompt"];
intents = ["warning", "error", "confirmation", "announcement", "step-required", "help", "saving"]; intents = ["warning", "error", "confirmation", "announcement", "step-required", "help", "mini"];
_.each(types, function(type) { _.each(types, function(type) {
_.each(intents, function(intent) { _.each(intents, function(intent) {
// "class" is a reserved word in Javascript, so use "klass" instead // "class" is a reserved word in Javascript, so use "klass" instead
...@@ -201,8 +201,7 @@ _.each(types, function(type) { ...@@ -201,8 +201,7 @@ _.each(types, function(type) {
}); });
}); });
// set more sensible defaults for Notification-Saving views // set more sensible defaults for Notification-Mini views
var savingOptions = CMS.Views.Notification.Saving.prototype.options; var miniOptions = CMS.Views.Notification.Mini.prototype.options;
savingOptions.minShown = 1250; miniOptions.minShown = 1250;
savingOptions.closeIcon = false; miniOptions.closeIcon = false;
...@@ -34,7 +34,7 @@ CMS.Views.ShowTextbook = Backbone.View.extend({ ...@@ -34,7 +34,7 @@ CMS.Views.ShowTextbook = Backbone.View.extend({
text: gettext("Delete"), text: gettext("Delete"),
click: function(view) { click: function(view) {
view.hide(); view.hide();
var delmsg = new CMS.Views.Notification.Saving({ var delmsg = new CMS.Views.Notification.Mini({
title: gettext("Deleting") + "…" title: gettext("Deleting") + "…"
}).show(); }).show();
textbook.destroy({ textbook.destroy({
...@@ -121,7 +121,7 @@ CMS.Views.EditTextbook = Backbone.View.extend({ ...@@ -121,7 +121,7 @@ CMS.Views.EditTextbook = Backbone.View.extend({
if(e && e.preventDefault) { e.preventDefault(); } if(e && e.preventDefault) { e.preventDefault(); }
this.setValues(); this.setValues();
if(!this.model.isValid()) { return; } if(!this.model.isValid()) { return; }
var saving = new CMS.Views.Notification.Saving({ var saving = new CMS.Views.Notification.Mini({
title: gettext("Saving") + "…" title: gettext("Saving") + "…"
}).show(); }).show();
var that = this; var that = this;
......
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