mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-29 17:44:27 -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",
|
dataType: "jsonp",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
if (!data.query || !data.query.results) return;
|
||||||
var json = data.query.results.json;
|
var json = data.query.results.json;
|
||||||
var html = json.html;
|
var html = json.html;
|
||||||
var ratio = json.height / json.width;
|
var ratio = json.height / json.width;
|
||||||
|
|
|
@ -292,11 +292,19 @@ var statusLength = null;
|
||||||
var statusKeymap = null;
|
var statusKeymap = null;
|
||||||
var statusIndent = null;
|
var statusIndent = null;
|
||||||
|
|
||||||
$.get(serverurl + '/views/statusbar.html', function (template) {
|
function getStatusBarTemplate(callback) {
|
||||||
statusBarTemplate = template;
|
$.get(serverurl + '/views/statusbar.html', function (template) {
|
||||||
});
|
statusBarTemplate = template;
|
||||||
|
if (callback) callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getStatusBarTemplate();
|
||||||
|
|
||||||
function addStatusBar() {
|
function addStatusBar() {
|
||||||
|
if (!statusBarTemplate) {
|
||||||
|
getStatusBarTemplate(addStatusBar);
|
||||||
|
return;
|
||||||
|
}
|
||||||
statusBar = $(statusBarTemplate);
|
statusBar = $(statusBarTemplate);
|
||||||
statusCursor = statusBar.find('.status-cursor');
|
statusCursor = statusBar.find('.status-cursor');
|
||||||
statusFile = statusBar.find('.status-file');
|
statusFile = statusBar.find('.status-file');
|
||||||
|
@ -1469,7 +1477,7 @@ socket.on('info', function (data) {
|
||||||
});
|
});
|
||||||
socket.on('error', function (data) {
|
socket.on('error', function (data) {
|
||||||
console.error(data);
|
console.error(data);
|
||||||
if (data.message.indexOf('AUTH failed') === 0)
|
if (data.message && data.message.indexOf('AUTH failed') === 0)
|
||||||
location.href = "./403";
|
location.href = "./403";
|
||||||
});
|
});
|
||||||
socket.on('disconnect', function (data) {
|
socket.on('disconnect', function (data) {
|
||||||
|
|
Loading…
Reference in a new issue