Fix missing placeholder in the Slide app

pull/1/head
yflory 8 years ago
parent 7d6e15e465
commit 6f0d33dc1d

@ -134,7 +134,7 @@ define([
var $modal = $pad.contents().find('#modal');
var $content = $pad.contents().find('#content');
Slide.setModal($modal, $content, $pad, ifrw);
Slide.setModal($modal, $content, $pad, ifrw, Messages.slideInitialState);
var enterPresentationMode = function (shouldLog) {
Slide.show(true, $textarea.val());
@ -240,7 +240,7 @@ define([
var shjson = stringifyInner(textValue);
module.patchText(shjson);
Slide.update(textValue || Messages.slideInitialState);
Slide.update(textValue);
if (module.realtime.getUserDoc() !== shjson) {
console.error("realtime.getUserDoc() !== shjson");
@ -648,7 +648,7 @@ define([
updateMetadata(userDoc);
editor.setValue(newDoc || '');
Slide.update(newDoc || Messages.slideInitialState);
Slide.update(newDoc);
if (Visible.isSupported()) {
Visible.onChange(function (yes) {

@ -18,6 +18,7 @@ define([
var $modal;
var $content;
var $pad;
var placeholder;
Slide.onChange = function (f) {
if (typeof(f) === 'function') {
@ -160,6 +161,7 @@ define([
var update = Slide.update = function (content) {
if (!Slide.shown) { return; }
if (!content) { content = placeholder; }
var old = Slide.content[Slide.index];
Slide.content = content.split(/\n\s*\-\-\-\s*\n/).filter(truthy);
if (old !== Slide.content[Slide.index]) {
@ -256,11 +258,12 @@ define([
});
};
Slide.setModal = function ($m, $c, $p, iframe) {
Slide.setModal = function ($m, $c, $p, iframe, ph) {
$modal = Slide.$modal = $m;
$content = Slide.$content = $c;
$pad = Slide.$pad = $p;
ifrw = Slide.ifrw = iframe;
placeholder = Slide.placeholder = ph;
addEvent();
};

Loading…
Cancel
Save