', {
- 'class': 'cp-splitter'
- }).appendTo($iframe.find('#previewContainer'));
+ if (!$iframe.has('.cp-splitter').length) {
+ var $preview = $iframe.find('#previewContainer');
+ var splitter = $('
', {
+ 'class': 'cp-splitter'
+ }).appendTo($preview);
+
+ $preview.on('scroll', function() {
+ splitter.css('top', $preview.scrollTop() + 'px');
+ });
- var $target = $iframe.find('.CodeMirror');
- splitter.on('mousedown', function (e) {
- e.preventDefault();
- var x = e.pageX;
- var w = $target.width();
+ var $target = $iframe.find('.CodeMirror');
- $iframe.on('mouseup mousemove', function handler(evt) {
- if (evt.type === 'mouseup') {
- $iframe.off('mouseup mousemove', handler);
- return;
- }
- $target.css('width', (w - x + evt.pageX) + 'px');
+ splitter.on('mousedown', function (e) {
+ e.preventDefault();
+ var x = e.pageX;
+ var w = $target.width();
+
+ $iframe.on('mouseup mousemove', function handler(evt) {
+ if (evt.type === 'mouseup') {
+ $iframe.off('mouseup mousemove', handler);
+ return;
+ }
+ $target.css('width', (w - x + evt.pageX) + 'px');
+ });
});
- });
+ }
Cryptpad.removeLoadingScreen();
setEditable(true);
diff --git a/www/common/toolbar2.js b/www/common/toolbar2.js
index 4a8032ad4..519700624 100644
--- a/www/common/toolbar2.js
+++ b/www/common/toolbar2.js
@@ -624,9 +624,14 @@ define([
}).appendTo(toolbar.$top);
// We need to override the "a" tag action here because it is inside the iframe!
+ var inDrive = /^\/drive/;
+
+ var href = inDrive ? '/index.html' : '/drive/';
+ var buttonTitle = inDrive ? Messages.header_homeTitle : Messages.header_logoTitle;
+
var $aTag = $('
', {
- href: "/drive/",
- title: Messages.header_logoTitle,
+ href: href,
+ title: buttonTitle,
'class': "cryptpad-logo"
}).append($('
', {
src: '/customize/images/logo_white.png'
@@ -634,10 +639,10 @@ define([
var onClick = function (e) {
e.preventDefault();
if (e.ctrlKey) {
- window.open('/drive/');
+ window.open(href);
return;
}
- window.location = "/drive/";
+ window.location = href;
};
var onContext = function (e) { e.stopPropagation(); };