Submodules

This commit is contained in:
Mo Bitar
2018-01-26 12:35:03 -06:00
parent 5a26b89e86
commit 457eb6f043
4 changed files with 20 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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