Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
better way to handle themes
Browse files Browse the repository at this point in the history
  • Loading branch information
zaggino committed Mar 2, 2017
1 parent 2d197fb commit 8a3eab0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/extensibility/ExtensionManagerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,9 @@ define(function (require, exports, module) {
context.removalAllowed = this.model.source === "installed" &&
!context.failedToStart && !hasPendingAction;
var isDefaultOrInstalled = this.model.source === "default" || this.model.source === "installed";
context.disablingAllowed = isDefaultOrInstalled && !context.disabled && !hasPendingAction;
context.enablingAllowed = isDefaultOrInstalled && context.disabled && !hasPendingAction;
var isDefaultAndTheme = this.model.source === "default" && context.metadata.theme;
context.disablingAllowed = isDefaultOrInstalled && !isDefaultAndTheme && !context.disabled && !hasPendingAction;
context.enablingAllowed = isDefaultOrInstalled && !!isDefaultAndTheme && context.disabled && !hasPendingAction;

// Copy over helper functions that we share with the registry app.
["lastVersionDate", "authorInfo"].forEach(function (helper) {
Expand Down
8 changes: 3 additions & 5 deletions src/htmlContent/extension-manager-view-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@
{{#showUpdateButton}}
</div><div>
{{/showUpdateButton}}
{{^metadata.theme}}
<button class="btn btn-mini disable" data-extension-id="{{metadata.name}}">
{{Strings.DISABLE}}
</button>
{{/metadata.theme}}
<button class="btn btn-mini disable" data-extension-id="{{metadata.name}}">
{{Strings.DISABLE}}
</button>
{{/disablingAllowed}}
{{#enablingAllowed}}
<button class="btn btn-mini enable" data-extension-id="{{metadata.name}}">
Expand Down

0 comments on commit 8a3eab0

Please sign in to comment.