Skip to content

Commit

Permalink
[#1879] Use max of 100% for updatePeriodValues()
Browse files Browse the repository at this point in the history
  • Loading branch information
gabemart committed Nov 3, 2015
1 parent 43d6a33 commit a2b7cd6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions akvo/rsr/static/scripts-src/project-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ if (firstAccordionChild !== null) {
displayAddButton(periodId, true);
} else {
periodNode.querySelector('.expand-indicator-period').click();
periodNode.querySelector('.expand-indicator-period').click();
}
});

Expand Down Expand Up @@ -1163,6 +1164,8 @@ if (firstAccordionChild !== null) {
var newValue = oldActual + change;
var completionPercentage = ((newValue - baseline) / (target - baseline)) * 100;

if (completionPercentage > 100) completionPercentage = 100;

period.setAttribute('period-start', oldStart + change);
period.setAttribute('period-actual', newValue);
period.querySelector('.indicator-bar-progress-text').textContent = newValue;
Expand Down
3 changes: 3 additions & 0 deletions akvo/rsr/static/scripts-src/project-main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ if (firstAccordionChild !== null) {
displayAddButton(periodId, true);
} else {
periodNode.querySelector('.expand-indicator-period').click();
periodNode.querySelector('.expand-indicator-period').click();
}
});

Expand Down Expand Up @@ -1163,6 +1164,8 @@ if (firstAccordionChild !== null) {
var newValue = oldActual + change;
var completionPercentage = ((newValue - baseline) / (target - baseline)) * 100;

if (completionPercentage > 100) completionPercentage = 100;

period.setAttribute('period-start', oldStart + change);
period.setAttribute('period-actual', newValue);
period.querySelector('.indicator-bar-progress-text').textContent = newValue;
Expand Down
2 changes: 1 addition & 1 deletion akvo/rsr/static/styles-src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,7 @@ body.translationBarActive div.skiptranslate ~ article, body.translationBarActive
width: 0px;
position: absolute;
bottom: -5px;
left: 9px;
left: 10px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #007ab8; }
Expand Down
2 changes: 1 addition & 1 deletion akvo/rsr/static/styles-src/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@ body {
width: 0px;
position: absolute;
bottom: -5px;
left: 9px;
left: 10px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid rgb(0, 122, 184);
Expand Down

0 comments on commit a2b7cd6

Please sign in to comment.