Fix viewAjaxCallback might be called on null

This commit is contained in:
Wu Cheng-Han 2016-11-01 15:04:48 +08:00
parent ba2bfa2188
commit 25fa503981
3 changed files with 3 additions and 4 deletions

View file

@ -204,8 +204,7 @@ function parseMeta(md, edit, view, toc, tocAffix) {
} }
} }
var viewAjaxCallback = null; window.viewAjaxCallback = null;
window.viewAjaxCallback = viewAjaxCallback;
//regex for extra tags //regex for extra tags
var spaceregex = /\s*/; var spaceregex = /\s*/;

View file

@ -97,7 +97,7 @@ var queryOptions = Reveal.getQueryHash() || {};
var options = extend(defaultOptions, options, queryOptions); var options = extend(defaultOptions, options, queryOptions);
Reveal.initialize(options); Reveal.initialize(options);
viewAjaxCallback = function () { window.viewAjaxCallback = function () {
Reveal.layout(); Reveal.layout();
}; };

View file

@ -138,7 +138,7 @@ function setupSyncAreas(edit, view, markdown) {
var scrollMap, lineHeightMap, viewTop, viewBottom; var scrollMap, lineHeightMap, viewTop, viewBottom;
viewAjaxCallback = clearMap; window.viewAjaxCallback = clearMap;
function clearMap() { function clearMap() {
scrollMap = null; scrollMap = null;