Skip to content

Commit e843bc2

Browse files
committed
fix(progress-circle): remove references to window
* Removes the references to `window` in the progressCircle component. * A couple of minor coding style tweaks. Fixes #837.
1 parent 3c74ae0 commit e843bc2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/progress-circle/progress-circle.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const DURATION_INDETERMINATE = 667;
1616
/** Duration of the indeterminate animation. */
1717
const DURATION_DETERMINATE = 225;
1818
/** Start animation value of the indeterminate animation */
19-
let startIndeterminate = 3;
19+
const startIndeterminate = 3;
2020
/** End animation value of the indeterminate animation */
21-
let endIndeterminate = 80;
21+
const endIndeterminate = 80;
2222

2323

2424
export type ProgressCircleMode = 'determinate' | 'indeterminate';
@@ -124,13 +124,13 @@ export class MdProgressCircle implements OnDestroy {
124124
get mode() {
125125
return this._mode;
126126
}
127-
set mode(m: ProgressCircleMode) {
128-
if (m == 'indeterminate') {
127+
set mode(_mode: ProgressCircleMode) {
128+
if (_mode === 'indeterminate') {
129129
this._startIndeterminateAnimation();
130130
} else {
131131
this._cleanupIndeterminateAnimation();
132132
}
133-
this._mode = m;
133+
this._mode = _mode;
134134
}
135135
private _mode: ProgressCircleMode = 'determinate';
136136

@@ -184,7 +184,7 @@ export class MdProgressCircle implements OnDestroy {
184184
private _startIndeterminateAnimation() {
185185
let rotationStartPoint = 0;
186186
let start = startIndeterminate;
187-
let end = endIndeterminate;
187+
let end = endIndeterminate;
188188
let duration = DURATION_INDETERMINATE;
189189
let animate = () => {
190190
this._animateCircle(start, end, materialEase, duration, rotationStartPoint);
@@ -250,8 +250,8 @@ function clamp(v: number) {
250250
* Returns the current timestamp either based on the performance global or a date object.
251251
*/
252252
function now() {
253-
if (window.performance && window.performance.now) {
254-
return window.performance.now();
253+
if (typeof performance !== 'undefined' && performance.now) {
254+
return performance.now();
255255
}
256256
return Date.now();
257257
}

0 commit comments

Comments
 (0)