fix(sheets): Attach sheets to the toolbar at correct offset

This commit is contained in:
Ben Gotow 2016-04-22 13:21:23 -07:00
parent 0174b4d20f
commit f951d85f45
2 changed files with 6 additions and 2 deletions

View file

@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/nylas/N1/issues"
},
"electronVersion": "0.37.6",
"electronVersion": "0.37.7",
"dependencies": {
"async": "^0.9",
"atom-keymap": "^6.1.1",

View file

@ -198,7 +198,8 @@ class Toolbar extends React.Component
return unless @mounted
# Find our item containers that are tied to specific columns
columnToolbarEls = ReactDOM.findDOMNode(@).querySelectorAll('[data-column]')
el = ReactDOM.findDOMNode(@)
columnToolbarEls = el.querySelectorAll('[data-column]')
# Find the top sheet in the stack
sheet = document.querySelectorAll("[name='Sheet']")[@props.depth]
@ -215,6 +216,9 @@ class Toolbar extends React.Component
columnToolbarEl.style.left = "#{columnEl.offsetLeft}px"
columnToolbarEl.style.width = "#{columnEl.offsetWidth}px"
# Record our overall height for sheets
remote.getCurrentWindow().setSheetOffset(el.clientHeight)
_onWindowResize: =>
@recomputeLayout()