Skip to content

Commit 1bca69d

Browse files
committed
MOBILE-2103 core: Fix timer styles
1 parent bee6cf3 commit 1bca69d

File tree

6 files changed

+41
-28
lines changed

6 files changed

+41
-28
lines changed

www/addons/mod/quiz/scss/styles.scss

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,34 @@ p.mma-mod-quiz-warning {
3838

3939
// Remove padding-top and bottom from navigation bar to minimize height used.
4040
.mma-mod-quiz-subheader {
41-
.row {
42-
padding-top: 0px;
43-
padding-bottom: 0px;
44-
}
45-
.col {
41+
padding-top: 0px;
42+
padding-bottom: 0px;
43+
44+
.row, .col {
4645
padding-top: 0px;
4746
padding-bottom: 0px;
4847
}
4948
.mm-timer {
50-
line-height: $button-bar-button-height
49+
min-height: 41px;
50+
border: 0;
51+
padding: 2px 0 1px 25px;
52+
53+
.icon {
54+
left: 0;
55+
font-size: $item-font-size * 3 /2;
56+
}
57+
58+
label {
59+
font-size: $item-font-size - 2;
60+
}
61+
62+
span {
63+
display: block;
64+
}
65+
66+
span.mm-timesup {
67+
line-height: 40px;
68+
}
5169
}
5270
}
5371

www/addons/mod/quiz/templates/player.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
</div>
2121
</ion-header-bar>
22-
<ion-content padding="true" mm-state-class delegate-handle="mmaModQuizPlayerScroll" ng-class="{'has-subheader': dataLoaded && questions.length && !quizAborted && !showSummary}">
22+
<ion-content mm-state-class delegate-handle="mmaModQuizPlayerScroll" ng-class="{'has-subheader': dataLoaded && questions.length && !quizAborted && !showSummary}">
2323
<mm-loading hide-until="dataLoaded">
2424
<div class="list padding" ng-if="!attempt">
2525
<button class="button button-block" ng-click="start()">{{ 'mma.mod_quiz.startattempt' | translate }}</button>

www/addons/mod/quiz/templates/preflight-modal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1 class="title">{{ preflightModalTitle | translate}}</h1>
77
<form class="list">
88
<mma-quiz-access-rule ng-repeat="directive in accessRulesDirectives"></mma-quiz-access-rule>
99
<div class="item">
10-
<button class="button button-block" ng-click="start(true)">{{ 'mm.core.send' | translate }}</button>
10+
<button class="button button-block button-positive" ng-click="start(true)">{{ 'mm.core.send' | translate }}</button>
1111
</div>
1212
</form>
1313
</ion-content>

www/core/directives/timer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ angular.module('mm.core')
5050
timeInterval;
5151

5252
// Add mm-timer class.
53-
element.addClass('mm-timer');
53+
element.addClass('mm-timer item item-icon-left');
5454
scope.text = attrs.timerText || '';
5555

5656
// Check time left every 200ms.

www/core/scss/styles.scss

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -817,32 +817,29 @@ p.mm-error { // Deprecated, use one of the above mm-error classes.
817817
// Timer.
818818
mm-timer {
819819
display: block;
820-
}
821820

822-
// Style timer in items.
823-
mm-timer.mm-timer .item {
824821
span, label {
825-
color: $item-default-text;
826822
font-size: $item-font-size;
823+
color: $item-default-text;
827824
}
828825
span {
829826
font-weight: bold;
830827
}
831-
}
832828

833-
// Create the timer warning colors. Go from $mm-timer-color to $mm-timer-warn-color.
834-
@for $i from 0 through $mm-timer-iterations {
835-
mm-timer.mm-timer.mm-timer-timeleft-#{$i} .item {
836-
background-color: mix($mm-timer-color, $mm-timer-warn-color, ($i / $mm-timer-iterations) * 100);
837-
@if $i <= $mm-timer-iterations / 2 {
838-
label, span, i {
839-
color: $white;
829+
// Create the timer warning colors. Go from $mm-timer-color to $mm-timer-warn-color.
830+
@for $i from 0 through $mm-timer-iterations {
831+
&.mm-timer-timeleft-#{$i} {
832+
background-color: mix($mm-timer-color, $mm-timer-warn-color, ($i / $mm-timer-iterations) * 100);
833+
@if $i <= $mm-timer-iterations / 2 {
834+
label, span, i {
835+
color: $white;
836+
}
840837
}
841838
}
842-
843839
}
844840
}
845841

842+
846843
.mm-monospaced {
847844
font-family: Andale Mono,Monaco,Courier New,DejaVu Sans Mono,monospace;
848845
}

www/core/templates/timer.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<div class="item item-text-wrap item-icon-left">
2-
<i class="icon ion-clock"></i>
3-
<label ng-if="text">{{text}} </label>
4-
<span ng-if="timeLeft > 0">{{ timeLeft | mmSecondsToHMS }}</span>
5-
<span ng-if="timeLeft <= 0">{{ 'mm.core.timesup' | translate }}</span>
6-
</div>
1+
<i class="icon ion-clock"></i>
2+
<label ng-if="timeLeft > 0 && text">{{text}} </label>
3+
<span ng-if="timeLeft > 0">{{ timeLeft | mmSecondsToHMS }}</span>
4+
<span class="mm-timesup" ng-if="timeLeft <= 0">{{ 'mm.core.timesup' | translate }}</span>

0 commit comments

Comments
 (0)