Commit e6c3644b by Usman Khalid Committed by Andy Armstrong

Quality fixes.

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