use site defaults if list setting is undefined, save per list columnWidth

This commit is contained in:
j 2015-04-02 13:13:03 +02:00
parent 8b97cd5bd7
commit 77270873e6

View file

@ -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