From 3c35a55422611f56e8387e16fcf967ecc297d4c7 Mon Sep 17 00:00:00 2001 From: Santiago Siri Date: Fri, 27 Oct 2017 16:21:11 -0400 Subject: [PATCH] min width for placed votes in bar --- imports/ui/modules/Vote.js | 1 + imports/ui/templates/components/decision/liquid/liquid.html | 2 +- imports/ui/templates/components/decision/liquid/liquid.js | 6 ++++++ imports/ui/templates/layout/sidebar/sidebar.js | 1 - 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/imports/ui/modules/Vote.js b/imports/ui/modules/Vote.js index 565624a7f..1e90d9eeb 100644 --- a/imports/ui/modules/Vote.js +++ b/imports/ui/modules/Vote.js @@ -235,6 +235,7 @@ export class Vote { const MAX_PERCENTAGE_PRECISION = 7; const barWidth = $(`#voteBar-${this.voteId}`).width(); const placedWidth = $(`#votePlaced-${this.voteId}`).width(); + console.log(placedWidth); const precisionRange = parseInt((MAX_PERCENTAGE_PRECISION * barWidth) / 100, 10); const precisionValue = parseInt((inputPixels * MAX_VOTES_PRECISION) / precisionRange, 10); diff --git a/imports/ui/templates/components/decision/liquid/liquid.html b/imports/ui/templates/components/decision/liquid/liquid.html index 004ae4bd9..0c2daad0e 100644 --- a/imports/ui/templates/components/decision/liquid/liquid.html +++ b/imports/ui/templates/components/decision/liquid/liquid.html @@ -103,6 +103,6 @@
{{/if}} -
+
diff --git a/imports/ui/templates/components/decision/liquid/liquid.js b/imports/ui/templates/components/decision/liquid/liquid.js index 741ed8b08..116074a77 100644 --- a/imports/ui/templates/components/decision/liquid/liquid.js +++ b/imports/ui/templates/components/decision/liquid/liquid.js @@ -453,6 +453,12 @@ Template.bar.helpers({ placed() { return agreement(this._id, this.editable); }, + min() { + if (agreement(this._id, this.editable).toNumber() > 0) { + return 'min-width: 10px;'; + } + return ''; + }, unanimous(value) { const quantity = parseInt(Session.get(this._id)[value] - Session.get(this._id).inBallot, 10); if (quantity === Session.get(this._id).balance) { diff --git a/imports/ui/templates/layout/sidebar/sidebar.js b/imports/ui/templates/layout/sidebar/sidebar.js index 3260285ad..29f9734f5 100644 --- a/imports/ui/templates/layout/sidebar/sidebar.js +++ b/imports/ui/templates/layout/sidebar/sidebar.js @@ -70,7 +70,6 @@ function getList(db, sort) { */ function getDelegates() { const delegates = _.sortBy(getDelegatesMenu(), (user) => { return parseInt(0 - (user.sent + user.received), 10); }); - console.log(delegates); const delegateList = []; for (const i in delegates) { delegateList.push(Meteor.users.find({ _id: delegates[i].userId }).fetch()[0]);