loleaflet: When the 'premission' is 'edit', request a session immediately.

This commit is contained in:
Jan Holesovsky 2016-02-04 20:36:39 +01:00
parent 5848cff634
commit 41378e9945

View file

@ -72,6 +72,11 @@ L.Map = L.Evented.extend({
this._addLayers(this.options.layers);
this._socket = L.socket(this);
// when editing, we need the LOK session right away
if (options.permission === 'edit') {
this._socket.sendMessage('requestloksession');
}
// Inhibit the context menu - the browser thinks that the document
// is just a bunch of images, hence the context menu is useless (tdf#94599)
this.on('contextmenu', function() {});