Select non-visual plugin when it starts.

This commit is contained in:
Julia Radzhabova 2016-08-03 12:41:36 +03:00
parent d1ea727e4c
commit 58c3fd33c0
3 changed files with 51 additions and 37 deletions

View file

@ -219,8 +219,7 @@ define([
onPluginShow: function(plugin, variationIndex) { onPluginShow: function(plugin, variationIndex) {
var variation = plugin.get_Variations()[variationIndex]; var variation = plugin.get_Variations()[variationIndex];
if (!variation.get_Visual()) return; if (variation.get_Visual()) {
if (variation.get_InsideMode()) { if (variation.get_InsideMode()) {
this.panelPlugins.openInsideMode(plugin.get_Name(), ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + variation.get_Url()); this.panelPlugins.openInsideMode(plugin.get_Name(), ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + variation.get_Url());
} else { } else {
@ -255,13 +254,17 @@ define([
}); });
me.pluginDlg.show(); me.pluginDlg.show();
} }
} else
this.panelPlugins.openNotVisualMode(plugin.get_Guid());
}, },
onPluginClose: function() { onPluginClose: function() {
if (this.pluginDlg) if (this.pluginDlg)
this.pluginDlg.close(); this.pluginDlg.close();
else else if (this.panelPlugins.iframePlugin)
this.panelPlugins.closeInsideMode(); this.panelPlugins.closeInsideMode();
else
this.panelPlugins.closeNotVisualMode();
}, },
onPluginResize: function(width, height, callback) { onPluginResize: function(width, height, callback) {

View file

@ -172,6 +172,16 @@ define([
this.pluginsPanel.toggleClass('hidden', false); this.pluginsPanel.toggleClass('hidden', false);
}, },
openNotVisualMode: function(pluginGuid) {
var rec = this.viewPluginsList.store.findWhere({guid: pluginGuid});
if (rec)
this.viewPluginsList.cmpEl.find('#' + rec.get('id')).parent().addClass('selected');
},
closeNotVisualMode: function() {
this.viewPluginsList.cmpEl.find('.selected').removeClass('selected');
},
_onLoad: function() { _onLoad: function() {
if (this.loadMask) if (this.loadMask)
this.loadMask.hide(); this.loadMask.hide();

View file

@ -27,10 +27,11 @@
&:hover, &:hover,
&.over { &.over {
background-color: @secondary; background-color: @secondary;
.plugin-icon {
.box-shadow(0 0 0 2px transparent);
} }
&.selected {
background-color: @primary;
color: #fff;
} }
} }