When changing the title of a presentation, the title in the bottom of the slide should also change

This commit is contained in:
Caleb James DeLisle 2017-10-02 15:04:44 +03:00
parent f95acda758
commit 12e82e80ec
2 changed files with 9 additions and 1 deletions

View File

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

View File

@ -303,6 +303,7 @@ define([
Slide.setTitle = function (titleObj) {
Title = titleObj;
Title.onTitleChange(function () { draw(Slide.index); });
};
return Slide;