on xenial help sign in
don't set left anchor margin twice
commit2f2147f470d023aedcb1f8e78170793be9e9735a authorAlbert Astals <albert.astals@canonical.com> dateTue 6 May 2014, 10:41 (12 years ago) parentfd487f2
1 file changed+5−1
plugins/Dash/CardCreator.js+5−1
plugins/Dash/CardCreator.js+5−1
@@ -204,9 +204,11 @@ function cardString(template, components) {
204204 }
205205 }
206206 var headerLeftAnchor;
207+ var headerLeftAnchorHasMagin = false;
207208 if (isHorizontal && hasArt) {
208209 headerLeftAnchor = 'anchors.left: artShapeHolder.right; \
209210 anchors.leftMargin: units.gu(1);';
211+ headerLeftAnchorHasMagin = true;
210212 } else {
211213 headerLeftAnchor = 'anchors.left: parent.left;';
212214 }
@@ -237,8 +239,10 @@ function cardString(template, components) {
237239 var anchors = "";
238240 if (!hasHeaderRow) {
239241 anchors += headerLeftAnchor;
240− anchors += 'anchors.leftMargin: units.gu(1);'
241242 anchors += headerVerticalAnchors;
243+ if (!headerLeftAnchorHasMagin) {
244+ anchors += 'anchors.leftMargin: units.gu(1);'
245+ }
242246 } else {
243247 anchors = "anchors.verticalCenter: parent.verticalCenter;"
244248 }