mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
Fixed minor bugs
This commit is contained in:
parent
b824fc8cf3
commit
85078fd328
2 changed files with 13 additions and 4 deletions
|
@ -366,6 +366,7 @@ function finishView(view) {
|
|||
},
|
||||
dataType: "jsonp",
|
||||
success: function (data) {
|
||||
if (!data.query || !data.query.results) return;
|
||||
var json = data.query.results.json;
|
||||
var html = json.html;
|
||||
var ratio = json.height / json.width;
|
||||
|
|
|
@ -292,11 +292,19 @@ var statusLength = null;
|
|||
var statusKeymap = null;
|
||||
var statusIndent = null;
|
||||
|
||||
$.get(serverurl + '/views/statusbar.html', function (template) {
|
||||
statusBarTemplate = template;
|
||||
});
|
||||
function getStatusBarTemplate(callback) {
|
||||
$.get(serverurl + '/views/statusbar.html', function (template) {
|
||||
statusBarTemplate = template;
|
||||
if (callback) callback();
|
||||
});
|
||||
}
|
||||
getStatusBarTemplate();
|
||||
|
||||
function addStatusBar() {
|
||||
if (!statusBarTemplate) {
|
||||
getStatusBarTemplate(addStatusBar);
|
||||
return;
|
||||
}
|
||||
statusBar = $(statusBarTemplate);
|
||||
statusCursor = statusBar.find('.status-cursor');
|
||||
statusFile = statusBar.find('.status-file');
|
||||
|
@ -1469,7 +1477,7 @@ socket.on('info', function (data) {
|
|||
});
|
||||
socket.on('error', function (data) {
|
||||
console.error(data);
|
||||
if (data.message.indexOf('AUTH failed') === 0)
|
||||
if (data.message && data.message.indexOf('AUTH failed') === 0)
|
||||
location.href = "./403";
|
||||
});
|
||||
socket.on('disconnect', function (data) {
|
||||
|
|
Loading…
Reference in a new issue