Small fixes

This commit is contained in:
RainLoop Team 2014-10-23 21:59:21 +04:00
parent 300cee0b6e
commit 3e9a7a55c6
15 changed files with 405 additions and 292 deletions

View file

@ -21,7 +21,6 @@
;
this.capa = !!Settings.settingsGet('PremType');
this.capa = true;
this.title = ko.observable(Settings.settingsGet('Title'));
this.title.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
@ -37,6 +36,8 @@
this.loginCss = ko.observable(Settings.settingsGet('LoginCss'));
this.loginCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.loginPowered = ko.observable(!!Settings.settingsGet('LoginPowered'));
}
BrandingAdminSetting.prototype.onBuild = function ()
@ -46,30 +47,37 @@
Remote = require('Storage/Admin/Remote')
;
_.delay(function () {
var
f1 = Utils.settingsSaveHelperSimpleFunction(self.title.trigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.loadingDesc.trigger, self)
;
self.title.subscribe(function (sValue) {
Remote.saveAdminConfig(f1, {
'Title': Utils.trim(sValue)
});
});
self.loadingDesc.subscribe(function (sValue) {
Remote.saveAdminConfig(f2, {
'LoadingDescription': Utils.trim(sValue)
});
});
}, 50);
if (this.capa)
{
_.delay(function () {
var
f1 = Utils.settingsSaveHelperSimpleFunction(self.title.trigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.loadingDesc.trigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.loginLogo.trigger, self),
f4 = Utils.settingsSaveHelperSimpleFunction(self.loginDescription.trigger, self),
f5 = Utils.settingsSaveHelperSimpleFunction(self.loginCss.trigger, self)
;
self.title.subscribe(function (sValue) {
Remote.saveAdminConfig(f1, {
'Title': Utils.trim(sValue)
});
});
self.loadingDesc.subscribe(function (sValue) {
Remote.saveAdminConfig(f2, {
'LoadingDescription': Utils.trim(sValue)
});
});
self.loginLogo.subscribe(function (sValue) {
Remote.saveAdminConfig(f3, {
'LoginLogo': Utils.trim(sValue)
@ -88,7 +96,13 @@
});
});
}, 50);
self.loginPowered.subscribe(function (bValue) {
Remote.saveAdminConfig(null, {
'LoginPowered': bValue ? '1' : '0'
});
});
}, 100);
}
};

View file

@ -1,7 +1,7 @@
.b-admin-branding {
.disabled-form {
opacity: 0.5;
opacity: 0.4;
}
}

View file

@ -206,6 +206,14 @@ select {
margin-left: 0;
}
.alert a {
color: #c09853;
}
.alert.alert-info a {
color: #3a87ad;
}
.alert.alert-error a {
color: #b94a48;
}

View file

@ -28,7 +28,7 @@
this.adminManLoadingVisibility = Data.adminManLoadingVisibility;
this.capa = !!Settings.settingsGet('PremType');
this.capa = false;
this.capa = false; // TODO
kn.constructorEnd(this);
}

View file

@ -42,6 +42,7 @@
this.logoImg = Utils.trim(Settings.settingsGet('LoginLogo'));
this.loginDescription = Utils.trim(Settings.settingsGet('LoginDescription'));
this.logoCss = Utils.trim(Settings.settingsGet('LoginCss'));
this.logoPowered = !!Settings.settingsGet('LoginPowered');
this.emailError = ko.observable(false);
this.passwordError = ko.observable(false);