Add plugin button to specified tab

This commit is contained in:
Julia Radzhabova
2024-02-05 20:43:36 +03:00
parent 40dd9edff3
commit 862e4b0bdc

View File

@ -419,6 +419,11 @@ define([
me.backgroundPlugins.push(model);
return;
}
if (model.get('tab')) {
me.toolbar && me.toolbar.addCustomItems(model.get('tab'), [me.viewPlugins.createPluginButton(model)]);
return;
}
//if (new_rank === 1 || new_rank === 2) return; // for test
if ((new_rank === 0 || new_rank === 2) && !isBackground) {
_group = me.addBackgroundPluginsButton(_group);
@ -872,7 +877,8 @@ define([
original: item,
isDisplayedInViewer: isDisplayedInViewer,
isBackgroundPlugin: pluginVisible && isBackgroundPlugin,
isSystem: isSystem
isSystem: isSystem,
tab: item.tab ? {action: item.tab.id, caption: ((typeof item.tab.text == 'object') ? item.tab.text[lang] || item.tab.text['en'] : item.tab.text) || ''} : undefined
};
updatedItem ? updatedItem.set(props) : arr.push(new Common.Models.Plugin(props));
}