From 5c6edfbc74d77c849362d2b7a13a295c9dd09633 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sat, 27 Jan 2018 09:53:59 -0600 Subject: [PATCH] Editor stack reload --- app/assets/javascripts/app/controllers/editor.js | 5 +++-- app/assets/stylesheets/app/_editor.scss | 10 +--------- app/assets/templates/editor.html.haml | 3 ++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/app/controllers/editor.js b/app/assets/javascripts/app/controllers/editor.js index 448c99d96..02b5143ca 100644 --- a/app/assets/javascripts/app/controllers/editor.js +++ b/app/assets/javascripts/app/controllers/editor.js @@ -420,7 +420,6 @@ angular.module('app') */ componentManager.registerHandler({identifier: "editor", areas: ["note-tags", "editor-stack", "editor-editor"], activationHandler: function(component){ - if(component.area === "note-tags") { // Autocomplete Tags this.tagsComponent = component.active ? component : null; @@ -431,6 +430,8 @@ angular.module('app') } else { this.selectedEditor = null; } + } else if(component.area == "editor-stack") { + this.reloadComponentContext(); } }.bind(this), contextRequestHandler: function(component){ return this.note; @@ -487,7 +488,7 @@ angular.module('app') this.componentStack = componentManager.componentsForArea("editor-stack"); for(var component of this.componentStack) { if(component.active) { - component.hidden = component.isExplicitlyDisabledForItem(this.note); + component.hidden = !this.note || component.isExplicitlyDisabledForItem(this.note); } } diff --git a/app/assets/stylesheets/app/_editor.scss b/app/assets/stylesheets/app/_editor.scss index 9080ee9c4..a1afdd7bb 100644 --- a/app/assets/stylesheets/app/_editor.scss +++ b/app/assets/stylesheets/app/_editor.scss @@ -119,15 +119,7 @@ $heading-height: 75px; .component-stack-item { width: 100%; position: relative; - - &:not(:last-child) { - border-bottom: 1px solid $bg-color; - } - - &:first-child { - border-top: 1px solid $bg-color; - } - + border-top: 1px solid $bg-color; iframe { width: 100%; } diff --git a/app/assets/templates/editor.html.haml b/app/assets/templates/editor.html.haml index 0c4c5630d..e3bdd5a5d 100644 --- a/app/assets/templates/editor.html.haml +++ b/app/assets/templates/editor.html.haml @@ -53,4 +53,5 @@ %p.medium-padding{"style" => "padding-top: 0 !important;"} There was an error decrypting this item. Ensure you are running the latest version of this app, then sign out and sign back in to try again. #editor-pane-component-stack - %component-view.component-view.component-stack-item.border-color{"ng-repeat" => "component in ctrl.componentStack", "ng-if" => "component.active", "ng-show" => "!component.hidden", "manual-dealloc" => "true", "component" => "component"} + %component-view.component-view.component-stack-item.border-color{"ng-repeat" => "component in ctrl.componentStack", + "ng-if" => "component.active", "ng-show" => "!component.hidden", "manual-dealloc" => "true", "component" => "component"}