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 Original file line Diff line number Diff line change
Expand Up @@ -659,17 +659,18 @@ class Player extends Component {
if (value === '') { if (value === '') {
// If an empty string is given, reset the dimension to be automatic // If an empty string is given, reset the dimension to be automatic
this[privDimension] = undefined; this[privDimension] = undefined;
} else { this.updateStyleEl_();
const parsedVal = parseFloat(value); return;
}


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


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


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


Expand Down

0 comments on commit ad1b47b

Please sign in to comment.