Fix a bug preventing reconnection in drive

pull/1/head
yflory 8 years ago
parent 89da142204
commit 65054119cf

@ -270,11 +270,11 @@ define([
'class': 'lag' 'class': 'lag'
}); });
var title; var title;
if (typeof lag !== "undefined") { if (lag) {
lagErrors = 0; lagErrors = 0;
firstConnection = false; firstConnection = false;
title = Messages.lag + ' : ' + lag + ' ms\n'; title = Messages.lag + ' : ' + lag + ' ms\n';
if (lag.waiting || lag > 1000) { if (lag && lag.waiting || lag > 1000) {
lagLight.addClass('lag-orange'); lagLight.addClass('lag-orange');
title += Messages.orangeLight; title += Messages.orangeLight;
} else { } else {

@ -180,6 +180,9 @@ span.fa-folder-open {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
} }
#content.readonly {
background: #e6e6e6;
}
#content h1 { #content h1 {
padding-left: 10px; padding-left: 10px;
margin-top: 10px; margin-top: 10px;

@ -3,6 +3,7 @@
@tree-lines-col: #888; @tree-lines-col: #888;
@content-bg: @tree-bg; @content-bg: @tree-bg;
@content-bg-ro: darken(@content-bg, 10%);
@content-fg: @tree-fg; @content-fg: @tree-fg;
@info-box-bg: #ddddff; @info-box-bg: #ddddff;
@info-box-border: #bbb; @info-box-border: #bbb;
@ -219,6 +220,9 @@ span {
flex: 1; flex: 1;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
&.readonly {
background: @content-bg-ro;
}
h1 { h1 {
padding-left: 10px; padding-left: 10px;
margin-top: 10px; margin-top: 10px;

@ -18,6 +18,15 @@ define([
var $iframe = $('#pad-iframe').contents(); var $iframe = $('#pad-iframe').contents();
var ifrw = $('#pad-iframe')[0].contentWindow; var ifrw = $('#pad-iframe')[0].contentWindow;
var $tree = $iframe.find("#tree");
var $content = $iframe.find("#content");
var $driveToolbar = $iframe.find("#driveToolbar");
var $contextMenu = $iframe.find("#treeContextMenu");
var $contentContextMenu = $iframe.find("#contentContextMenu");
var $defaultContextMenu = $iframe.find("#defaultContextMenu");
var $trashTreeContextMenu = $iframe.find("#trashTreeContextMenu");
var $trashContextMenu = $iframe.find("#trashContextMenu");
Cryptpad.addLoadingScreen(); Cryptpad.addLoadingScreen();
var onConnectError = function (info) { var onConnectError = function (info) {
Cryptpad.errorLoadingScreen(Messages.websocketError); Cryptpad.errorLoadingScreen(Messages.websocketError);
@ -127,8 +136,14 @@ define([
var setEditable = function (state) { var setEditable = function (state) {
APP.editable = state; APP.editable = state;
if (!state) { $iframe.find('[draggable="true"]').attr('draggable', false); } if (!state) {
else { $iframe.find('[draggable="false"]').attr('draggable', true); } $content.addClass('readonly');
$iframe.find('[draggable="true"]').attr('draggable', false);
}
else {
$content.removeClass('readonly');
$iframe.find('[draggable="false"]').attr('draggable', true);
}
}; };
// Icons // Icons
@ -196,16 +211,6 @@ define([
var lastSelectTime; var lastSelectTime;
var selectedElement; var selectedElement;
var $tree = $iframe.find("#tree");
var $content = $iframe.find("#content");
var $driveToolbar = $iframe.find("#driveToolbar");
var $contextMenu = $iframe.find("#treeContextMenu");
var $contentContextMenu = $iframe.find("#contentContextMenu");
var $defaultContextMenu = $iframe.find("#defaultContextMenu");
var $trashTreeContextMenu = $iframe.find("#trashTreeContextMenu");
var $trashContextMenu = $iframe.find("#trashContextMenu");
if (!APP.readOnly) { if (!APP.readOnly) {
setEditable(true); setEditable(true);
} }
@ -1288,7 +1293,10 @@ define([
var $modeButton = createViewModeButton().appendTo($toolbar.find('.rightside')); var $modeButton = createViewModeButton().appendTo($toolbar.find('.rightside'));
var $title = createTitle(path).appendTo($toolbar.find('.rightside')); var $title = createTitle(path).appendTo($toolbar.find('.rightside'));
createNewButton(isInRoot).appendTo($toolbar.find('.leftside'));
// NewButton can be undefined if we're in read only mode
$toolbar.find('.leftside').append(createNewButton(isInRoot));
var $folderHeader = getFolderListHeader(); var $folderHeader = getFolderListHeader();
var $fileHeader = getFileListHeader(true); var $fileHeader = getFileListHeader(true);

Loading…
Cancel
Save