[DE] Fix preview toc

This commit is contained in:
Julia Radzhabova 2021-04-13 12:52:19 +03:00
parent 1799fb270c
commit e0ceb8a841
2 changed files with 6 additions and 6 deletions

View file

@ -312,7 +312,7 @@ define([
}, },
onTableContentsOpen: function(menu) { onTableContentsOpen: function(menu) {
this.api.asc_getButtonsTOC(menu.items[0].id, menu.items[1].id); this.api.asc_getButtonsTOC(menu.items[0].options.previewId, menu.items[1].options.previewId);
}, },
onNotesClick: function(type) { onNotesClick: function(type) {

View file

@ -235,15 +235,15 @@ define([
(new Promise(function (accept, reject) { (new Promise(function (accept, reject) {
accept(); accept();
})).then(function(){ })).then(function(){
var contentsTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem" class="item-contents"><div></div></a>'); var contentsTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem" class="item-contents"><div id="<%= options.previewId %>"></div></a>');
me.btnsContents.forEach( function(btn) { me.btnsContents.forEach( function(btn) {
btn.updateHint( me.tipContents ); btn.updateHint( me.tipContents );
var _menu = new Common.UI.Menu({ var _menu = new Common.UI.Menu({
cls: 'toc-menu shifted-left', cls: 'toc-menu shifted-left',
items: [ items: [
{template: contentsTemplate, offsety: 0, value: 0, id: 'id-toolbar-toc-0'}, {template: contentsTemplate, offsety: 0, value: 0, previewId: 'id-toolbar-toc-0'},
{template: contentsTemplate, offsety: 72, value: 1, id: 'id-toolbar-toc-1'}, {template: contentsTemplate, offsety: 72, value: 1, previewId: 'id-toolbar-toc-1'},
{caption: me.textContentsSettings, value: 'settings'}, {caption: me.textContentsSettings, value: 'settings'},
{caption: me.textContentsRemove, value: 'remove'} {caption: me.textContentsRemove, value: 'remove'}
] ]
@ -255,8 +255,8 @@ define([
me.contentsMenu = new Common.UI.Menu({ me.contentsMenu = new Common.UI.Menu({
cls: 'toc-menu shifted-left', cls: 'toc-menu shifted-left',
items: [ items: [
{template: contentsTemplate, offsety: 0, value: 0, id: 'id-toolbar-toc-menu-0'}, {template: contentsTemplate, offsety: 0, value: 0, previewId: 'id-toolbar-toc-menu-0'},
{template: contentsTemplate, offsety: 72, value: 1, id: 'id-toolbar-toc-menu-1'}, {template: contentsTemplate, offsety: 72, value: 1, previewId: 'id-toolbar-toc-menu-1'},
{caption: me.textContentsSettings, value: 'settings'}, {caption: me.textContentsSettings, value: 'settings'},
{caption: me.textContentsRemove, value: 'remove'} {caption: me.textContentsRemove, value: 'remove'}
] ]