From d80455cc865cb92797d6636463730ed1c180ee75 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 2 Apr 2015 13:18:52 +0200 Subject: [PATCH] edits and texts can have undefined edits/texts keys too --- static/js/UI.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/UI.js b/static/js/UI.js index 3b4c2b2bd..4999c5e68 100644 --- a/static/js/UI.js +++ b/static/js/UI.js @@ -188,7 +188,10 @@ pandora.UI = (function() { Ox.forEach(editSettings, function(value, key) { var editsKey = 'edits.' + that.encode(args.edit) + '.' + key; add[editsKey] = editsKey in args ? args[editsKey] - : pandora.user.ui.edits[args.edit] ? pandora.user.ui.edits[args.edit][key] + : ( + pandora.user.ui.edits[args.edit] + && !Ox.isUndefined(pandora.user.ui.edits[args.edit][key]) + ) ? pandora.user.ui.edits[args.edit][key] : value; }); } @@ -217,7 +220,10 @@ pandora.UI = (function() { textsSubKey = textsKey + '.' + key; return textsKey in args && key in args[textsKey] ? args[textsKey][key] : textsSubKey in args ? args[textSubKey] - : pandora.user.ui.texts[args.text] ? pandora.user.ui.texts[args.text][key] + : ( + pandora.user.ui.texts[args.text] + && !Ox.isUndefined(pandora.user.ui.texts[args.text][key]) + } ? pandora.user.ui.texts[args.text][key] : value; }); }