Commit e6c3644b by Usman Khalid Committed by Andy Armstrong

Quality fixes.

parent 3110cf6b
;(function (define, undefined) { ;(function (define, undefined) {
'use strict'; 'use strict';
define([ define([
'gettext', 'underscore', 'backbone', 'gettext', 'underscore', 'backbone'
], function (gettext, _, Backbone) { ], function (gettext, _, Backbone) {
var UserAccountModel = Backbone.Model.extend({ var UserAccountModel = Backbone.Model.extend({
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
default_public_account_fields: [] default_public_account_fields: []
}, },
parse : function(response, xhr) { parse : function(response) {
if (_.isNull(response)) { if (_.isNull(response)) {
return {}; return {};
} }
......
;(function (define, undefined) { ;(function (define, undefined) {
'use strict'; 'use strict';
define([ define([
'gettext', 'underscore', 'backbone', 'gettext', 'underscore', 'backbone'
], function (gettext, _, Backbone) { ], function (gettext, _, Backbone) {
var UserPreferencesModel = Backbone.Model.extend({ var UserPreferencesModel = Backbone.Model.extend({
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
'js/student_account/models/user_account_model', 'js/student_account/models/user_account_model',
'js/student_account/models/user_preferences_model', 'js/student_account/models/user_preferences_model',
'js/student_account/views/account_settings_fields', 'js/student_account/views/account_settings_fields',
'js/student_account/views/account_settings_view', 'js/student_account/views/account_settings_view'
], function (gettext, $, _, Backbone, FieldViews, UserAccountModel, UserPreferencesModel, ], function (gettext, $, _, Backbone, FieldViews, UserAccountModel, UserPreferencesModel,
AccountSettingsFieldViews, AccountSettingsView) { AccountSettingsFieldViews, AccountSettingsView) {
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
}) })
} }
] ]
}, }
]; ];
if (_.isArray(authData.providers)) { if (_.isArray(authData.providers)) {
...@@ -145,14 +145,14 @@ ...@@ -145,14 +145,14 @@
accountSettingsView.render(); accountSettingsView.render();
var showLoadingError = function (model, response, options) { var showLoadingError = function () {
accountSettingsView.showLoadingError(); accountSettingsView.showLoadingError();
}; };
userAccountModel.fetch({ userAccountModel.fetch({
success: function (model, response, options) { success: function () {
userPreferencesModel.fetch({ userPreferencesModel.fetch({
success: function (model, response, options) { success: function () {
accountSettingsView.renderFields(); accountSettingsView.renderFields();
}, },
error: showLoadingError error: showLoadingError
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
'gettext', 'jquery', 'underscore', 'backbone', 'js/mustache', 'js/views/fields' 'gettext', 'jquery', 'underscore', 'backbone', 'js/mustache', 'js/views/fields'
], function (gettext, $, _, Backbone, RequireMustache, FieldViews) { ], function (gettext, $, _, Backbone, RequireMustache, FieldViews) {
var Mustache = window.Mustache || RequireMustache;
var AccountSettingsFieldViews = {}; var AccountSettingsFieldViews = {};
AccountSettingsFieldViews.EmailFieldView = FieldViews.TextFieldView.extend({ AccountSettingsFieldViews.EmailFieldView = FieldViews.TextFieldView.extend({
...@@ -31,7 +29,7 @@ ...@@ -31,7 +29,7 @@
url: '/i18n/setlang/', url: '/i18n/setlang/',
data: data, data: data,
dataType: 'html', dataType: 'html',
success: function (data, status, xhr) { success: function () {
view.showSuccessMessage(); view.showSuccessMessage();
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
...@@ -65,7 +63,7 @@ ...@@ -65,7 +63,7 @@
type: 'POST', type: 'POST',
url: view.options.linkHref, url: view.options.linkHref,
data: data, data: data,
success: function (data, status, xhr) { success: function () {
view.showSuccessMessage() view.showSuccessMessage()
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
...@@ -79,7 +77,7 @@ ...@@ -79,7 +77,7 @@
gettext('We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'), gettext('We\'ve sent a message to {email_address}. Click the link in the message to reset your password.'),
{'email_address': this.model.get(this.options.emailAttribute)} {'email_address': this.model.get(this.options.emailAttribute)}
); );
}, }
}); });
AccountSettingsFieldViews.LanguageProficienciesFieldView = FieldViews.DropdownFieldView.extend({ AccountSettingsFieldViews.LanguageProficienciesFieldView = FieldViews.DropdownFieldView.extend({
...@@ -149,7 +147,7 @@ ...@@ -149,7 +147,7 @@
url: this.options.disconnectUrl, url: this.options.disconnectUrl,
data: data, data: data,
dataType: 'html', dataType: 'html',
success: function (data, status, xhr) { success: function () {
view.options.connected = false; view.options.connected = false;
view.render(); view.render();
view.showSuccessMessage(); view.showSuccessMessage();
...@@ -166,7 +164,7 @@ ...@@ -166,7 +164,7 @@
successMessage: function() { successMessage: function() {
return this.indicators['success'] + gettext('Successfully unlinked.'); return this.indicators['success'] + gettext('Successfully unlinked.');
}, }
}); });
return AccountSettingsFieldViews; return AccountSettingsFieldViews;
......
;(function (define, undefined) { ;(function (define, undefined) {
'use strict'; 'use strict';
define([ define([
'gettext', 'jquery', 'underscore', 'backbone', 'gettext', 'jquery', 'underscore', 'backbone'
], function (gettext, $, _, Backbone) { ], function (gettext, $, _, Backbone) {
var AccountSettingsView = Backbone.View.extend({ var AccountSettingsView = Backbone.View.extend({
......
...@@ -485,7 +485,7 @@ ...@@ -485,7 +485,7 @@
title: this.options.title, title: this.options.title,
linkTitle: this.options.linkTitle, linkTitle: this.options.linkTitle,
linkHref: this.options.linkHref, linkHref: this.options.linkHref,
message: this.helpMessage, message: this.helpMessage
})); }));
return this; return 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