-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(menu-surface): Update setPosition adapter API to use numeric values #4351
Changes from 4 commits
08f5fe9
5264ea9
acfef88
8501b4d
fb02775
344c208
fbc76c5
55ac7cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,7 +247,7 @@ class MDCMenuSurface extends MDCComponent { | |
getInnerDimensions: () => { | ||
return {width: this.root_.offsetWidth, height: this.root_.offsetHeight}; | ||
}, | ||
getAnchorDimensions: () => this.anchorElement && this.anchorElement.getBoundingClientRect(), | ||
getAnchorDimensions: () => this.anchorElement ? this.anchorElement.getBoundingClientRect() : null, | ||
getWindowDimensions: () => { | ||
return {width: window.innerWidth, height: window.innerHeight}; | ||
}, | ||
|
@@ -258,10 +258,10 @@ class MDCMenuSurface extends MDCComponent { | |
return {x: window.pageXOffset, y: window.pageYOffset}; | ||
}, | ||
setPosition: (position) => { | ||
this.root_.style.left = 'left' in position ? position.left : null; | ||
this.root_.style.right = 'right' in position ? position.right : null; | ||
this.root_.style.top = 'top' in position ? position.top : null; | ||
this.root_.style.bottom = 'bottom' in position ? position.bottom : null; | ||
this.root_.style.left = 'left' in position ? `${position.left}px` : ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this change from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Closure Compiler test suddenly complained that these values can't be TypeScript's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CSS specs seem to indicate that
|
||
this.root_.style.right = 'right' in position ? `${position.right}px` : ''; | ||
this.root_.style.top = 'top' in position ? `${position.top}px` : ''; | ||
this.root_.style.bottom = 'bottom' in position ? `${position.bottom}px` : ''; | ||
}, | ||
setMaxHeight: (height) => { | ||
this.root_.style.maxHeight = height; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is trailing comma valid in closure annotations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's Closure, so probably not. Removed. Thanks!