Fix WorkspaceElement tests

This commit is contained in:
Antonio Scandurra
2017-12-22 12:13:39 +01:00
parent 011766768a
commit c05615b8f8

View File

@@ -9,8 +9,12 @@ class PaneResizeHandleElement extends HTMLElement
@addEventListener 'mousedown', @resizeStarted.bind(this)
attachedCallback: ->
@isHorizontal = @parentElement.classList.contains("horizontal")
@classList.add if @isHorizontal then 'horizontal' else 'vertical'
# For some reason Chromium 58 is firing the attached callback after the
# element has been detached, so we ignore the callback when a parent element
# can't be found.
if @parentElement
@isHorizontal = @parentElement.classList.contains("horizontal")
@classList.add if @isHorizontal then 'horizontal' else 'vertical'
detachedCallback: ->
@resizeStopped()