on xenial help sign in
account for horizontal and no mascot
8c028a2Albert Astals
plugins/Dash/CardCreator.js+6−10
@@ -211,16 +211,11 @@ function createCardComponent(parent, template, components) {
211 }
211 }
212 }
212 }
213 var headerLeftAnchor;
213 var headerLeftAnchor;
214− if (isHorizontal) {
214+ if (isHorizontal && hasArt) {
215− if (hasArt) {
216− headerLeftAnchor = 'anchors.left: artShapeHolder.right; \
215+ headerLeftAnchor = 'anchors.left: artShapeHolder.right; \
217− anchors.leftMargin: units.gu(1);';
218− } else {
219− headerLeftAnchor = 'anchors.left: parent.left;';
220− }
221− } else {
222− headerLeftAnchor = 'anchors.left: parent.left; \
223 anchors.leftMargin: units.gu(1);';
216 anchors.leftMargin: units.gu(1);';
217+ } else {
218+ headerLeftAnchor = 'anchors.left: parent.left;';
224 }
219 }
225
220
226 if (hasHeaderRow) {
221 if (hasHeaderRow) {
@@ -288,12 +283,13 @@ function createCardComponent(parent, template, components) {
288 } else {
283 } else {
289 color = '"grey"';
284 color = '"grey"';
290 }
285 }
286+
291 var anchors = "anchors.right: parent.right;";
287 var anchors = "anchors.right: parent.right;";
292 if (hasMascot) {
288 if (hasMascot) {
293 anchors += 'anchors.left: mascotImage.right; \
289 anchors += 'anchors.left: mascotImage.right; \
294 anchors.leftMargin: units.gu(1);';
290 anchors.leftMargin: units.gu(1);';
295 } else {
291 } else {
296− anchors += 'anchors.left: parent.left;';
292+ anchors += headerLeftAnchor;
297 }
293 }
298 anchors += headerVerticalAnchors;
294 anchors += headerVerticalAnchors;
299
295