From 12e82e80ec4f789cba63cafcf6996b9e9c649467 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 2 Oct 2017 15:04:44 +0300 Subject: [PATCH] When changing the title of a presentation, the title in the bottom of the slide should also change --- www/common/sframe-common-title.js | 9 ++++++++- www/slide/slide.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index f07da43fa..d1d0b43fa 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -1,4 +1,7 @@ -define(['jquery'], function ($) { +define([ + 'jquery', + '/common/common-util.js' +], function ($, Util) { var module = {}; module.create = function (Common, cfg) { @@ -6,6 +9,7 @@ define(['jquery'], function ($) { var metadataMgr = Common.getMetadataMgr(); var sframeChan = Common.getSframeChannel(); var titleUpdated; + var evTitleChange = Util.mkEvent(); exp.defaultTitle = metadataMgr.getMetadata().defaultTitle; exp.title = document.title; @@ -50,6 +54,7 @@ define(['jquery'], function ($) { metadataMgr.onTitleChange(function (title) { sframeChan.query('Q_SET_PAD_TITLE_IN_DRIVE', title, function (err) { if (err) { return; } + evTitleChange.fire(title); if (titleUpdated) { titleUpdated(undefined, title); } }); }); @@ -62,6 +67,8 @@ define(['jquery'], function ($) { }; }; + exp.onTitleChange = evTitleChange.reg; + return exp; }; diff --git a/www/slide/slide.js b/www/slide/slide.js index 3477a6a32..86738d1f8 100644 --- a/www/slide/slide.js +++ b/www/slide/slide.js @@ -303,6 +303,7 @@ define([ Slide.setTitle = function (titleObj) { Title = titleObj; + Title.onTitleChange(function () { draw(Slide.index); }); }; return Slide;