Skip to content

Commit

Permalink
Merge pull request #2747 from OZhurbenko/meteor-ui
Browse files Browse the repository at this point in the history
Polling update
  • Loading branch information
ritzalam committed Aug 26, 2015
2 parents 55516cd + 30a1d0d commit a2b613e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
6 changes: 6 additions & 0 deletions bigbluebutton-html5/app/client/globals.coffee
Expand Up @@ -182,6 +182,12 @@ Handlebars.registerHelper 'whiteboardSize', (section) ->
Handlebars.registerHelper "getPollQuestions", ->
polls = BBB.getCurrentPoll(getInSession('userId'))
if polls? and polls isnt undefined
number = polls.poll_info.poll.answers.length
widthStyle = "width: calc(75%/" + number + ");"
marginStyle = "margin-left: calc(25%/" + (number*2) + ");" + "margin-right: calc(23%/" + (number*2) + ");"
buttonStyle = widthStyle + marginStyle
for answer in polls.poll_info.poll.answers
answer.style = buttonStyle
return polls.poll_info.poll.answers

@getSortedUserList = (users) ->
Expand Down
16 changes: 13 additions & 3 deletions bigbluebutton-html5/app/client/stylesheets/whiteboard.less
Expand Up @@ -102,6 +102,7 @@
padding-top:10px;
padding-bottom:10px;
border-top: 1px solid extract(@lightGrey, 3);
font-size: 0; /* to remove default 4px gaps between the buttons caused by display: inline-block */
}

.pollButtons {
Expand All @@ -110,9 +111,17 @@
font-weight: bold;
border: 1px solid extract(@lightGrey, 3);
height: 100%;
margin: 0 1rem 0 1rem;
padding: auto;

padding-left: 0rem !important; /*overwriting the default foundation padding */
padding-right: 0rem !important; /*overwriting the default foundation padding */
max-width: calc(~'100%/6'); /* the actual width and margins are calculated in the code */
/* truncating the text inside the buttons */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
/* the end of truncating */
span {
max-width: 80%;
}
&:hover {
background: #3A82D4;
}
Expand Down Expand Up @@ -225,6 +234,7 @@
padding: 0;
border-radius: 50%;
background: #3896D3;
opacity: 0.55;
&:hover {
background: #3A82D4;
}
Expand Down
Expand Up @@ -18,7 +18,7 @@
{{#if isPollStarted}}
<div class="polling">
{{#each getPollQuestions}}
{{> makeButton btn_class="pollButtons" rel="tooltip" data_placement="top" label=key answer=id}}
{{> makeButton btn_class="pollButtons" rel="tooltip" data_placement="top" label=key answer=id style=style }}
{{/each}}
</div>
{{/if}}
Expand Down
Expand Up @@ -26,13 +26,13 @@ class @WhiteboardPollModel extends WhiteboardToolModel
backgroundColor = "#ffffff"
verticalPadding = 0
horizontalPadding = 0
calcFontSize = 20
calcFontSize = 30
votesTotal = 0
maxNumVotes = 0
textArray = []

#creating an array of text objects for the labels, percentages and number inside line bars
if startingData.result? and startingData.result.length > 1
if startingData.result?
#counting the total number of votes and finding the biggest number of votes
for i in [0..startingData.result.length-1]
votesTotal += startingData.result[i].num_votes
Expand Down Expand Up @@ -236,7 +236,7 @@ calculateFontAndWidth = (textArray, calcFontSize, width, height, x, y) ->
test = getRenderedTextSize(textArray[i][j], calcFontSize)
spanWidth = test[0]
spanHeight = test[1]
if spanWidth > 40 or spanWidth > maxLineWidth or spanHeight > maxLineHeight
if spanWidth > maxLineWidth or spanHeight > maxLineHeight
calcFontSize -= 1
flag = true
calculatedData.push calcFontSize
Expand Down

0 comments on commit a2b613e

Please sign in to comment.