From 69ae084836acbc9279e3eb200f14c37fa2fb4db5 Mon Sep 17 00:00:00 2001 From: Darren Date: Tue, 6 Nov 2012 17:53:26 +0000 Subject: [PATCH] Client: Settings window updating on change --- client/assets/dev/applet_settings.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/client/assets/dev/applet_settings.js b/client/assets/dev/applet_settings.js index 481a1c9..2072fe1 100644 --- a/client/assets/dev/applet_settings.js +++ b/client/assets/dev/applet_settings.js @@ -5,12 +5,21 @@ }, initialize: function (options) { - var settings = _kiwi.global.settings; - this.$el = $($('#tmpl_applet_settings').html()); - this.$el.find('.setting-theme').val(settings.get('theme')); - this.$el.find('.setting-scrollback').val(settings.get('scrollback')); + // Incase any settings change while we have this open, update them + _kiwi.global.settings.on('change', this.loadSettings, this); + + // Now actually show the current settings + this.loadSettings(); + }, + + + loadSettings: function () { + var settings = _kiwi.global.settings; + + this.$el.find('.setting-theme').val(settings.get('theme') || 'relaxed'); + this.$el.find('.setting-scrollback').val(settings.get('scrollback') || '250'); if (typeof settings.get('show_joins_parts') === 'undefined' || settings.get('show_joins_parts')) { this.$el.find('.setting-show_joins_parts').attr('checked', true); @@ -18,7 +27,8 @@ this.$el.find('.setting-show_joins_parts').attr('checked', false); } }, - + + saveSettings: function () { var settings = _kiwi.global.settings; -- 2.25.1