Skip to content

Commit f95ad0c

Browse files
committed
Bug Fix
Updated clock face to use the new autoIncrement API Fixed bug caused by trailing commas
1 parent 17c942f commit f95ad0c

6 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/flipclock/js/faces/counter.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
FlipClock.CounterFace = FlipClock.Face.extend({
1414

15-
autoStart: false,
15+
// autoStart: false,
1616

1717
minimumDigits: 2,
1818

@@ -24,9 +24,9 @@
2424
*/
2525

2626
constructor: function(factory, options) {
27-
factory.timer.interval = 0;
28-
factory.autoStart = false;
29-
factory.running = true;
27+
//factory.timer.interval = 0;
28+
factory.autoStart = options.autoStart ? true : false;
29+
//factory.running = true;
3030

3131
factory.increment = function() {
3232
factory.countdown = false;
@@ -52,12 +52,6 @@
5252
this.base(factory, options);
5353
},
5454

55-
/**
56-
* Increments the time with each face flip
57-
*/
58-
59-
increment: function() {},
60-
6155
/**
6256
* Build the clock face
6357
*/
@@ -95,6 +89,10 @@
9589
if(!time) {
9690
time = this.factory.getTime().digitize([this.factory.getTime().time]);
9791
}
92+
93+
if(this.autoStart) {
94+
this.autoIncrement();
95+
}
9896

9997
this.base(time, doNotAddPlayClass);
10098
},

src/flipclock/js/faces/dailycounter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@
7575
time = this.factory.time.getDayCounter(this.showSeconds);
7676
}
7777

78+
this.autoIncrement();
79+
7880
this.base(time, doNotAddPlayClass);
79-
},
81+
}
8082

8183
/**
8284
* Clear the excess digits from the tens columns for sec/min

src/flipclock/js/faces/hourlycounter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@
7171
flip: function(time, doNotAddPlayClass) {
7272
if(!time) {
7373
time = this.factory.time.getHourCounter();
74-
}
74+
}
75+
76+
this.autoIncrement();
77+
7578
this.base(time, doNotAddPlayClass);
76-
},
79+
}
7780

7881
/**
7982
* Clear the excess digits from the tens columns for sec/min

src/flipclock/js/faces/minutecounter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
if(!time) {
4343
time = this.factory.time.getMinuteCounter();
4444
}
45+
4546
this.base(time, doNotAddPlayClass);
4647
}
4748

src/flipclock/js/faces/twelvehourclock.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@
7777

7878
_isPM: function() {
7979
return this._getMeridium() == 'PM' ? true : false;
80-
},
80+
}
8181

8282
/**
8383
* Clear the excess digits from the tens columns for sec/min
8484
*/
8585

86+
/*
8687
_clearExcessDigits: function() {
8788
var tenSeconds = this.factory.lists[this.factory.lists.length - 2];
8889
var tenMinutes = this.factory.lists[this.factory.lists.length - 4];
@@ -92,6 +93,7 @@
9293
tenMinutes.$el.find('li:last-child').remove();
9394
}
9495
}
96+
*/
9597

9698
});
9799

src/flipclock/js/faces/twentyfourhourclock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
time = time ? time : this.factory.time.getMilitaryTime();
6363

6464
this.base(time, doNotAddPlayClass);
65-
},
65+
}
6666

6767
/**
6868
* Clear the excess digits from the tens columns for sec/min

0 commit comments

Comments
 (0)