Fixing attempt for timer position
[westcastle.git] / js / index.js
index 02e490e..f58a403 100644 (file)
@@ -154,8 +154,8 @@ new Vue({
                                },
                                setScore: function() {
                                        let sortedSessions = this.sessions[this.currentIndex]
-                                               .map( (s,i) => { return {value:s, index:i}; })
-                                               .sort( (a,b) => { return parseInt(b.value) - parseInt(a.value); });
+                                               .map( (s,i) => { return {value:parseInt(s), index:i}; })
+                                               .sort( (a,b) => { return b.value - a.value; });
                                        let pdts = [4, 2, 1, 0];
                                        // NOTE: take care of ex-aequos (spread points subtotal)
                                        let curSum = 0, curCount = 0, start = 0;
@@ -193,7 +193,7 @@ new Vue({
                                };
                        },
                        template: `
-                               <div id="timer" :style="{lineHeight: textHeight + 'px', fontSize: 0.66*textHeight + 'px'}">
+                               <div id="timer" :style="{lineHeight: divHeight + 'px', fontSize: 0.66*divHeight + 'px', width: divWidth + 'px', height: divHeight + 'px'}">
                                        <div @click.left="pauseResume()" @click.right.prevent="reset()" :class="{timeout:time==0}">
                                                {{ formattedTime }}
                                        </div>
@@ -206,9 +206,12 @@ new Vue({
                                        let minutes = Math.floor(this.time / 60);
                                        return this.padToZero(minutes) + ":" + this.padToZero(seconds);
                                },
-                               textHeight: function() {
+                               divHeight: function() {
                                        return screen.height;
                                },
+                               divWidth: function() {
+                                       return screen.width;
+                               },
                        },
                        methods: {
                                padToZero: function(a) {