Fix missing placeholder in the Slide app

This commit is contained in:
yflory
2017-02-06 12:14:33 +01:00
parent 7d6e15e465
commit 6f0d33dc1d
2 changed files with 7 additions and 4 deletions

View File

@@ -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();
};