Skip to content

Commit

Permalink
refactor: player.dimension() (#4704)
Browse files Browse the repository at this point in the history
  • Loading branch information
kocoten1992 authored and gkatsev committed Nov 1, 2017
1 parent 9acbcd8 commit ad1b47b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,17 +659,18 @@ class Player extends Component {
if (value === '') {
// If an empty string is given, reset the dimension to be automatic
this[privDimension] = undefined;
} else {
const parsedVal = parseFloat(value);
this.updateStyleEl_();
return;
}

if (isNaN(parsedVal)) {
log.error(`Improper value "${value}" supplied for for ${dimension}`);
return;
}
const parsedVal = parseFloat(value);

this[privDimension] = parsedVal;
if (isNaN(parsedVal)) {
log.error(`Improper value "${value}" supplied for for ${dimension}`);
return;
}

this[privDimension] = parsedVal;
this.updateStyleEl_();
}

Expand Down

0 comments on commit ad1b47b

Please sign in to comment.