Fix a race condition in the slide application

pull/1/head
yflory 8 years ago
parent c322aa440e
commit 5300bc363c

@ -32,7 +32,6 @@ define([
module.spinner.show(); module.spinner.show();
var ifrw = module.ifrw = $('#pad-iframe')[0].contentWindow;
var stringify = function (obj) { var stringify = function (obj) {
return JSONSortify(obj); return JSONSortify(obj);
}; };
@ -46,6 +45,7 @@ define([
}; };
$(function () { $(function () {
var ifrw = module.ifrw = $('#pad-iframe')[0].contentWindow;
var toolbar; var toolbar;
var secret = Cryptpad.getSecrets(); var secret = Cryptpad.getSecrets();
@ -126,7 +126,7 @@ define([
var $modal = $pad.contents().find('#modal'); var $modal = $pad.contents().find('#modal');
var $content = $pad.contents().find('#content'); var $content = $pad.contents().find('#content');
Slide.setModal($modal, $content, $pad); Slide.setModal($modal, $content, $pad, ifrw);
var enterPresentationMode = function (shouldLog) { var enterPresentationMode = function (shouldLog) {
Slide.show(true, $textarea.val()); Slide.show(true, $textarea.val());

@ -14,14 +14,15 @@ define([
content: [], content: [],
changeHandlers: [], changeHandlers: [],
}; };
var ifrw = $('#pad-iframe')[0].contentWindow; var ifrw;
var $modal; var $modal;
var $content; var $content;
var $pad; var $pad;
Slide.setModal = function ($m, $c, $p) { Slide.setModal = function ($m, $c, $p, iframe) {
$modal = Slide.$modal = $m; $modal = Slide.$modal = $m;
$content = Slide.$content = $c; $content = Slide.$content = $c;
$pad = Slide.$pad = $p; $pad = Slide.$pad = $p;
ifrw = Slide.ifrw = iframe;
}; };
Slide.onChange = function (f) { Slide.onChange = function (f) {

Loading…
Cancel
Save