lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js in gollum-2.1.4 vs lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js in gollum-2.1.6

- old
+ new

@@ -95,11 +95,11 @@ var POST = 'POST'; var markdown = 'markdown'; var txt = editorSession.getValue(); var msg = defaultCommitMessage(); - var newLocation = location.protocol + '//' + location.host + baseUrl; + var newLocation = baseUrl; // 'a%2Fb' => a/b if (pathName) { newLocation += '/' + unescape(pathName); pathName = pathName + '/'; // pathName must end with / @@ -395,27 +395,28 @@ var widthFourth = widthHalf / 2; var height = $( win ).height(); var heightHalf = height / 2; // height minus 50 so the end of document text doesn't flow off the page. - var editorContainerStyle = 'width:' + widthHalf + 'px;' + + // + 15 for scroll bar + var editorContainerStyle = 'width:' + (widthHalf + 15) + 'px;' + 'height:' + (height - 50) + 'px;' + 'left:' + (leftRight === false ? widthHalf + 'px;' : '0px;') + 'top:' + '40px;'; // use 40px for tool menu cssSet( editorContainer, editorContainerStyle ); editor.resize(); // width -2 for scroll bar & -10 for left offset var previewStyle = 'width:' + (widthHalf - 2 - 10) + 'px;' + 'height:' + height + 'px;' + 'left:' + (leftRight === false ? '10px;' : widthHalf + 'px;') + - 'top:' + '0px;'; + // preview panel top is equal to height of comment tool panel (40px) + 1 + 'top:41px;'; cssSet( preview, previewStyle ); // Resize tool panel - var toolPanelStyle = 'width:' + widthHalf + 'px;' + - 'left:' + (leftRight === false ? widthHalf + 'px;' : '0px;'); + var toolPanelStyle = 'width:50%;'; cssSet( toolPanel, toolPanelStyle ); // Resize comment related elements. var commentHidden = 'visibility:' + ( isCommentHidden === true ? 'hidden;' : 'visible;' ); @@ -426,13 +427,15 @@ 'top:' + (heightHalf / 2) + 'px;' + commentHidden; cssSet( commentEditorContainer, commentEditorContainerStyle ); commentEditor.resize(); + var commentToolPanelHeight = height / 4 - 40; + // In top subtract height (40px) of comment tool panel. var commentToolPanelStyle = 'width:' + widthHalf + 'px;' + 'left:' + widthFourth + 'px;' + - 'top:' + (height / 4 - 40) + 'px;' + + 'top:' + commentToolPanelHeight + 'px;' + commentHidden; cssSet( commentToolPanel, commentToolPanelStyle ); // Resize dimmer. var darknessStyle = 'width:' + width + 'px;' +