Skip to content

Commit

Permalink
Add support windows for unregistered plugins (connector).
Browse files Browse the repository at this point in the history
  • Loading branch information
K0R0L committed Apr 15, 2024
1 parent c0740ad commit b67add9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 14 additions & 6 deletions apps/common/main/lib/controller/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1198,11 +1198,19 @@ define([
if (typeof variation.descriptionLocale == 'object')
description = variation.descriptionLocale[lang] || variation.descriptionLocale['en'] || description || '';

var model = this.viewPlugins.storePlugins.findWhere({guid: guid}),
modes = model.get('variations'),
icons = variation.icons ? variation.icons : modes[model.get('currentVariation')].get('icons'),
parsedIcons = this.viewPlugins.parseIcons(icons),
icon_url = model.get('baseUrl') + parsedIcons['normal'];
var baseUrl = variation.baseUrl || "";
var model = this.viewPlugins.storePlugins.findWhere({guid: guid});
var icons = variation.icons;

if (model) {
if ("" === baseUrl)
baseUrl = model.get('baseUrl');
if (!icons)
icons = modes[model.get('currentVariation')].get('icons');
}

var parsedIcons = this.viewPlugins.parseIcons(icons),
icon_url = baseUrl + parsedIcons['normal'];

var $button = $('<div id="slot-btn-plugins-' + frameId + '"></div>'),
button = new Common.UI.Button({
Expand All @@ -1222,7 +1230,7 @@ define([
el: '#panel-plugins-' + frameId,
menu: menu,
frameId: frameId,
baseUrl: model.get('baseUrl'),
baseUrl: baseUrl,
icons: icons
});
this.viewPlugins.customPluginPanels[frameId].on('render:after', _.bind(this.onAfterRender, this, this.viewPlugins.customPluginPanels[frameId], frameId));
Expand Down
4 changes: 3 additions & 1 deletion apps/common/main/lib/view/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ define([

iconsStr2IconsObj: function(icons) {
let result = icons;
if (typeof result === 'string' && result.indexOf('%') !== -1) {
if (typeof result === 'string') {
if (result.indexOf('%') === -1)
return [icons, icons];
/*
valid params:
theme-type - {string} theme type (light|dark|common)
Expand Down

0 comments on commit b67add9

Please sign in to comment.