Skip to content

Commit

Permalink
fix(md-progress): set md-pixel-size on attached
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgaspar committed Nov 29, 2016
1 parent 7bc059a commit b7a83a7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/progress/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,24 @@ export class MdProgress {
// console.log('mdValueChanged, newValue:', JSON.stringify(newValue), 'oldValue:', JSON.stringify(oldValue));
// }

bind() {
// This disables property changed callbacks for any bindable properties during initialization
// Prevents mdPixelSize getting cleared by the mdSizeChanged event during binding
}

attached() {
this.mdPixelSizeChanged(this.mdPixelSize);
}

mdSizeChanged(newValue) {
this.mdPixelSize = null;
if (this.wrapper) {
this.wrapper.style.height = '';
this.wrapper.style.width = '';
}
}

mdPixelSizeChanged(newValue) {
if (isNaN(newValue)) {
this.mdPixelSize = null;
} else {
this.mdSize = '';
if (this.wrapper) {
this.wrapper.style.height = `${newValue}px`;
this.wrapper.style.width = `${newValue}px`;
}
if (this.wrapper) {
newValue = (newValue === null || newValue === '' || isNaN(newValue)) ? '' : `${newValue}px`;
this.wrapper.style.height = newValue;
this.wrapper.style.width = newValue;
}
}
}

0 comments on commit b7a83a7

Please sign in to comment.