Offset review panel when Ace scrollbar is visibl.e

This commit is contained in:
Paulo Reis 2016-11-17 12:02:45 +00:00
parent 2678a177fe
commit fe43f60b3d
3 changed files with 11 additions and 4 deletions

View file

@ -5,6 +5,8 @@ define [
"ide/review-panel/ChangesTracker"
], (App, EventEmitter, ColorManager, ChangesTracker) ->
App.controller "ReviewPanelController", ($scope, $element, ide, $timeout) ->
$reviewPanelEl = $element.find "#review-panel"
$scope.SubViews =
CUR_FILE : "cur_file"
OVERVIEW : "overview"
@ -21,6 +23,12 @@ define [
$scope.reviewPanelEventsBridge = new EventEmitter()
$scope.reviewPanelEventsBridge.on "aceScrollbarVisibilityChanged", (isVisible, scrollbarWidth) ->
if isVisible
$reviewPanelEl.css "right", "#{ scrollbarWidth }px"
else
$reviewPanelEl.css "right", "0"
changesTrackers = {}
$scope.$watch "editor.open_doc_id", (open_doc_id) ->

View file

@ -111,9 +111,6 @@ define [
# need to trigger the event back to the original panel.
ignoreNextPanelEvent = false
ignoreNextAceEvent = false
handleScrollbarVisibilityChanged = (isVisible, scrollbarWidth) ->
console.log isVisible, scrollbarWidth
scrollPanel = (scrollTop, height) ->
if ignoreNextAceEvent
@ -132,5 +129,4 @@ define [
scope.reviewPanelEventsBridge.emit "externalScroll", scrollTop
scope.reviewPanelEventsBridge.on "aceScroll", scrollPanel
scope.reviewPanelEventsBridge.on "aceScrollbarVisibilityChanged", handleScrollbarVisibilityChanged
}

View file

@ -485,6 +485,9 @@
right: @review-off-width;
.ace-editor-body {
overflow: visible;
.ace_scrollbar-v {
right: -@review-off-width;
}
}
}
}