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;