on xenial help sign in
Reorder params to make sure decodeURI doesn't have the problem with arg()
commitc8e3189301354b4e9a8772b2c0f117747d495232 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 26 Jan 2016, 14:41 (11 years ago) parentf40fe1e
1 file changed+6−6
plugins/Dash/CardCreator.js+6−6
plugins/Dash/CardCreator.js+6−6
@@ -16,9 +16,9 @@
1616
1717.pragma library
1818
19−// %1 is the template["card-background"] string
20−// %2 is the template["card-background"]["elements"][0]
21−// %3 is the template["card-background"]["elements"][1]
19+// %1 is the template["card-background"]["elements"][0]
20+// %2 is the template["card-background"]["elements"][1]
21+// %3 is the template["card-background"] string
2222var kBackgroundLoaderCode = 'Loader {\n\
2323 id: backgroundLoader; \n\
2424 objectName: "backgroundLoader"; \n\
@@ -46,14 +46,14 @@ var kBackgroundLoaderCode = 'Loader {\n\
4646 objectName: "backgroundImage"; \n\
4747 source: { \n\
4848 if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\
49− else return %1; \n\
49+ else return %3; \n\
5050 } \n\
5151 } \n\
5252 function getColor(index) { \n\
5353 if (cardData && typeof cardData["background"] === "object" \n\
5454 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { \n\
5555 return cardData["background"]["elements"][index]; \n\
56− } else return index === 0 ? %2 : %3; \n\
56+ } else return index === 0 ? %1 : %2; \n\
5757 } \n\
5858 } \n\
5959 }\n';
@@ -455,7 +455,7 @@ function cardString(template, components) {
455455 backgroundElements1 = '"%1"'.arg(element1);
456456 }
457457 }
458− code += kBackgroundLoaderCode.arg(templateCardBackground).arg(backgroundElements0).arg(backgroundElements1);
458+ code += kBackgroundLoaderCode.arg(backgroundElements0).arg(backgroundElements1).arg(templateCardBackground);
459459 }
460460
461461 if (hasArt) {