From 77270873e6fbec921dfb67d890fed0dda658d72e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 2 Apr 2015 13:13:03 +0200 Subject: [PATCH] use site defaults if list setting is undefined, save per list columnWidth --- static/js/UI.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/static/js/UI.js b/static/js/UI.js index df2b7de2..3b4c2b2b 100644 --- a/static/js/UI.js +++ b/static/js/UI.js @@ -83,7 +83,8 @@ pandora.UI = (function() { // if find has changed list Ox.forEach(listSettings, function(listSetting, setting) { // then for each setting that corresponds to a list setting - if (!pandora.user.ui.lists[list]) { + if (!pandora.user.ui.lists[list] + || Ox.isUndefined(pandora.user.ui.lists[list][listSetting])) { // either add the default setting add[setting] = pandora.site.user.ui[setting]; } else { @@ -131,6 +132,16 @@ pandora.UI = (function() { add[key] = pandora.site.user.ui[setting]; } }); + // set nested lisColumnWidth updates + Ox.forEach(args, function(value, key) { + if (Ox.startsWith(key, 'listColumnWidth.')) { + key = 'lists.' + that.encode(list) + '.columnWidth.' + + key.slice('listColumnWidth.'.length); + if (!(key in add)) { + add[key] = value; + } + } + }); if (args.item) { // when switching to an item, update list selection