Submodules
This commit is contained in:
@@ -89,7 +89,7 @@ class ComponentView {
|
||||
|
||||
$scope.getUrl = function() {
|
||||
var url = componentManager.urlForComponent($scope.component);
|
||||
$scope.component.runningLocally = url !== ($scope.component.url || $scope.component.hosted_url);
|
||||
$scope.component.runningLocally = (url !== $scope.component.url) && url !== ($scope.component.hosted_url);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,20 @@ class EditorMenu {
|
||||
$scope.defaultEditor = null;
|
||||
}
|
||||
|
||||
$scope.shouldDisplayRunningLocallyLabel = function(component) {
|
||||
if(!component.runningLocally) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(component == $scope.selectedEditor) {
|
||||
return true;
|
||||
} else if(component.area == "editor-stack") {
|
||||
return $scope.stackComponentEnabled(component);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.stackComponentEnabled = function(component) {
|
||||
return component.active && !component.isExplicitlyDisabledForItem($scope.currentItem);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
"circle" => "selectedEditor === editor && 'success'",
|
||||
"has-button" => "selectedEditor == editor || defaultEditor == editor", "button-text" => "defaultEditor == editor ? 'Undefault' : 'Set Default'",
|
||||
"button-action" => "toggleDefaultForEditor(editor)", "button-class" => "defaultEditor == editor ? 'warning' : 'info'"}
|
||||
.column{"ng-if" => "component.conflict_of"}
|
||||
.column{"ng-if" => "component.conflict_of || shouldDisplayRunningLocallyLabel(editor)"}
|
||||
%strong.red.medium{"ng-if" => "editor.conflict_of"} Conflicted copy
|
||||
.sublabel{"ng-if" => "shouldDisplayRunningLocallyLabel(editor)"} Running Locally
|
||||
|
||||
%a.no-decoration{"ng-if" => "editors.length == 0", "href" => "https://standardnotes.org/extensions", "target" => "blank"}
|
||||
%menu-row{"title" => "'Download More Editors'"}
|
||||
@@ -20,5 +21,6 @@
|
||||
%h4.title Editor Stack
|
||||
%menu-row{"ng-repeat" => "component in stack", "ng-click" => "selectComponent($event, component)", "title" => "component.name",
|
||||
"circle" => "stackComponentEnabled(component) ? 'success' : 'danger'"}
|
||||
.column{"ng-if" => "component.conflict_of"}
|
||||
.column{"ng-if" => "component.conflict_of || shouldDisplayRunningLocallyLabel(component)"}
|
||||
%strong.red.medium{"ng-if" => "component.conflict_of"} Conflicted copy
|
||||
.sublabel{"ng-if" => "shouldDisplayRunningLocallyLabel(component)"} Running Locally
|
||||
|
||||
Reference in New Issue
Block a user