From 0072e6618394a4f1861801c2e7674329261bcaa3 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 19 Jun 2013 12:44:16 +0100 Subject: [PATCH] Always float toolbar to top of page, not last branch node The check for the toolbar not overlapping the last branch node 'fixes' an edge case where the user has scrolled too far, and the viewport is shorter than the last branch. A more common problem caused by this is that if the last branch is very tall the toolbar disappears whenever you scroll past it. Bug: 48662 Change-Id: I1c7662f2b6f1ced6f80dec16c6ed69a8cc0c06c8 --- modules/ve/ui/ve.ui.Toolbar.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/ve/ui/ve.ui.Toolbar.js b/modules/ve/ui/ve.ui.Toolbar.js index a9a5cee3b8..26f6cc0257 100644 --- a/modules/ve/ui/ve.ui.Toolbar.js +++ b/modules/ve/ui/ve.ui.Toolbar.js @@ -87,15 +87,11 @@ ve.mixinClass( ve.ui.Toolbar, ve.EventEmitter ); */ ve.ui.Toolbar.prototype.onWindowScroll = function () { var scrollTop = this.$window.scrollTop(), - toolbarOffset = this.$.offset(), - $lastBranch = this.surface.$.find( '.ve-ce-documentNode > .ve-ce-branchNode:visible:last' ), - lastBranchOffset = $lastBranch.offset(), - belowLastBranch = $lastBranch.length && - scrollTop + this.$bar.height() >= lastBranchOffset.top; + toolbarOffset = this.$.offset(); if ( scrollTop > toolbarOffset.top ) { this.setPosition( - belowLastBranch ? lastBranchOffset.top - this.$.outerHeight() : 0, + 0, toolbarOffset.left, this.$window.width() - this.$.outerWidth() - toolbarOffset.left );