Commit 36b712ff authored by Sven Franck's avatar Sven Franck

app: updated dynamic value setting (still can't inherit through tree)

parent 4779f26f
......@@ -77,6 +77,7 @@
case "type":
case "rel":
case "alt":
case "src":
case "readonly":
case "size":
case "colspan":
......@@ -6620,7 +6621,7 @@
return RSVP.all(promise_list)
.then(function (response_list) {
var j, k, res_len, response, param_len, out_param;
var j, k, res_len, response, param_len, out_param, val;
// TODO: CUSTOM CODE, wrap in callback and make generic handler
for (j = 0, res_len = response_list.length; j < res_len; j += 1) {
......@@ -6628,7 +6629,9 @@
for (k = 0, param_len = param_list.length; k < param_len; k += 1) {
out_param = param_list[k];
if (response.field === out_param[1]) {
element.logic[out_param[0]] = response.value;
val = out_param[0];
element.logic[val] = element.logic[val] || "";
element.logic[val] += response.value;
}
}
}
......@@ -6645,20 +6648,22 @@
* @returns {object} kid
*/
app.util.setParam = function (kid, wrapper) {
var i, len, param_list, param, href, loc, sep;
var i, len, param_list, param, href, loc, splitter, val;
param_list = kid.logic.setParam;
for (i = 0, len = param_list.length; i < len; i += 1) {
param = param_list[i];
switch (param[1]) {
// NOTE: hacked for oauth redirect url TODO: remove, not generic!
// NOTE: hacked for oauth redirect url
// TODO: remove, not generic!
// TODO: find way to include encoding when setting a href
case "location":
href = kid.direct.href;
sep = href.indexOf("?") > 0 ? "&" : "?";
splitter = href.indexOf("?") > 0 ? "&" : "?";
loc = window.location;
kid.direct.href += sep + window.encodeURIComponent(param[0]) + "=" +
window.encodeURIComponent(
kid.direct.href += splitter + window.encodeURIComponent(param[0]) +
"=" + window.encodeURIComponent(
loc.origin + loc.pathname + loc.hash.split("?")[0]
);
break;
......@@ -6668,7 +6673,12 @@
if (param[1].split("subordinate_").length > 1) {
kid.needs_subordination = true;
} else {
kid.logic[param[0]] = wrapper.property_dict.data.doc[param[1]];
val = param[0];
kid.logic[val] = kid.logic[val] || "";
kid.logic[val] += wrapper.property_dict.data.doc[param[1]];
if (val === "href") {
kid.logic[val] = window.encodeURIComponent(kid.logic[val]);
}
delete kid.logic.setParam[i];
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment