Open separate windows with theme, update settings theme on change

This commit is contained in:
Scott Nonnenberg 2018-07-13 08:57:30 -07:00
parent d014fa779e
commit d8e5e5fcf2
10 changed files with 38 additions and 14 deletions

View file

@ -5,6 +5,7 @@ $(document).on('keyup', function(e) {
});
const $body = $(document.body);
$body.addClass(window.theme);
// got.js appears to need this to successfully submit debug logs to the cloud
window.setImmediate = window.nodeSetImmediate;

View file

@ -5,6 +5,7 @@ $(document).on('keyup', function(e) {
});
const $body = $(document.body);
$body.addClass(window.theme);
window.view = new Whisper.ConfirmationDialogView({
message: i18n('audioPermissionNeeded'),

View file

@ -5,6 +5,7 @@ $(document).on('keyup', function(e) {
});
const $body = $(document.body);
$body.addClass(window.theme);
const getInitialData = async () => ({
deviceName: await window.getDeviceName(),

View file

@ -1,5 +1,6 @@
/* global i18n: false */
/* global Whisper: false */
/* global $: false */
/* eslint-disable no-new */
@ -82,7 +83,14 @@
el: this.$('.theme-settings'),
name: 'theme-setting',
value: window.initialData.themeSetting,
setFn: window.setThemeSetting,
setFn: theme => {
$(document.body)
.removeClass('android')
.removeClass('android-dark')
.removeClass('ios')
.addClass(theme);
window.setThemeSetting(theme);
},
});
if (Settings.isAudioNotificationSupported()) {
new CheckboxView({