Fix Bug 38452

This commit is contained in:
Julia Radzhabova 2018-08-10 11:17:21 +03:00
parent 095d89c7fe
commit da61d33679

View file

@ -256,7 +256,7 @@ define([
win.show(); win.show();
break; break;
case 'remove': case 'remove':
if (currentTOC) if (currentTOC && props)
currentTOC = props.get_InternalClass(); currentTOC = props.get_InternalClass();
this.api.asc_RemoveTableOfContents(currentTOC); this.api.asc_RemoveTableOfContents(currentTOC);
break; break;
@ -265,9 +265,12 @@ define([
}, },
onTableContentsUpdate: function(type, currentTOC){ onTableContentsUpdate: function(type, currentTOC){
if (currentTOC) var props = this.api.asc_GetTableOfContentsPr(currentTOC);
currentTOC = this.api.asc_GetTableOfContentsPr(currentTOC).get_InternalClass(); if (props) {
this.api.asc_UpdateTableOfContents(type == 'pages', currentTOC); if (currentTOC && props)
currentTOC = props.get_InternalClass();
this.api.asc_UpdateTableOfContents(type == 'pages', currentTOC);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, },