Commit 3ecd7e34 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

global variable is not used

parent b1851ccf
......@@ -65,8 +65,9 @@ AbstractAdminPanel.prototype.init = function () {
* @param {function} params.setter
*/
AbstractAdminPanel.prototype.bindUserGuiPreference = function (params) {
var self = this;
params.jQueryObject.on(params.event, function () {
return ServerConnector.getLoggedUser().then(function (user) {
return self.getServerConnector().getLoggedUser().then(function (user) {
var oldValue = user.getPreferences().getGuiPreference(params.preferenceName, params.defaultValue);
var newValue = params.getter();
if (oldValue !== newValue) {
......@@ -74,11 +75,11 @@ AbstractAdminPanel.prototype.bindUserGuiPreference = function (params) {
var data = new UserPreferences();
data.setGuiPreference(params.preferenceName, newValue);
return ServerConnector.updateUserPreferences({user: user, preferences: data});
return self.getServerConnector().updateUserPreferences({user: user, preferences: data});
}
}).catch(GuiConnector.alert);
});
var promise = ServerConnector.getLoggedUser().then(function (user) {
var promise = self.getServerConnector().getLoggedUser().then(function (user) {
var value = user.getPreferences().getGuiPreference(params.preferenceName, params.defaultValue);
return params.setter(value);
});
......
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