Skip to content

Commit

Permalink
Fix bug in assets finder
Browse files Browse the repository at this point in the history
  • Loading branch information
Dovyski committed May 26, 2016
1 parent a98c28c commit 4e11b0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion css/style.css
Expand Up @@ -749,7 +749,6 @@ Sliding panel and panels content
}

.panel-content div.warning {
margin-top: 50%;
text-align: center;
padding: 10px;
}
Expand Down
11 changes: 7 additions & 4 deletions plugins/cc.codebot.asset.finder.js
Expand Up @@ -47,7 +47,7 @@ AssetFinder.Plugin.prototype.getPanelData = function(thePanel) {
return null;
};

AssetFinder.Plugin.prototype.initUIAfterProjectOpened = function(theProjectInfo) {
AssetFinder.Plugin.prototype.initUI = function(theProjectInfo) {
this.context.ui.addButton(AssetFinder.Plugin.meta + 'mainPanel', { icon: '<i class="fa fa-picture-o"></i>', panel: AssetFinder.Panel.Main });
};

Expand All @@ -65,8 +65,11 @@ AssetFinder.Plugin.prototype.getLicenses = function() {
};

AssetFinder.Plugin.prototype.activate = function() {
// TODO: activate only if there is any project open.
this.initUIAfterProjectOpened();
var aIde = this.context.plugins.get('cc.codebot.ide.web');

if(aIde.getActiveProject()) {
this.initUI();
}
};

AssetFinder.Plugin.prototype.deactivate = function() {
Expand All @@ -85,7 +88,7 @@ AssetFinder.Plugin.prototype.init = function(theContext) {

this.loadLicenses();

this.context.signals.projectOpened.add(this.initUIAfterProjectOpened, this);
this.context.signals.projectOpened.add(this.initUI, this);
};

AssetFinder.Plugin.meta = {
Expand Down

0 comments on commit 4e11b0e

Please sign in to comment.