fixes change editor glitch

This commit is contained in:
Mo Bitar
2017-03-10 14:31:17 -06:00
parent a8eab8aab7
commit f05ddb5cd1
3 changed files with 5 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ angular.module('app.frontend')
}.bind(this)); }.bind(this));
this.setNote = function(note, oldNote) { this.setNote = function(note, oldNote) {
this.noteReady = false;
var currentEditor = this.customEditor; var currentEditor = this.customEditor;
this.customEditor = null; this.customEditor = null;
this.showExtensions = false; this.showExtensions = false;
@@ -60,6 +61,7 @@ angular.module('app.frontend')
var setEditor = function(editor) { var setEditor = function(editor) {
this.customEditor = editor; this.customEditor = editor;
this.postNoteToExternalEditor(); this.postNoteToExternalEditor();
this.noteReady = true;
}.bind(this) }.bind(this)
var editor = this.editorForNote(note); var editor = this.editorForNote(note);
@@ -75,6 +77,7 @@ angular.module('app.frontend')
} }
} else { } else {
this.customEditor = null; this.customEditor = null;
this.noteReady = true;
} }
if(note.safeText().length == 0 && note.dummy) { if(note.safeText().length == 0 && note.dummy) {

View File

@@ -5,6 +5,7 @@ $heading-height: 75px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden; overflow-y: hidden;
background-color: white;
&.fullscreen { &.fullscreen {
width: 100%; width: 100%;

View File

@@ -38,7 +38,7 @@
%span.sr-only %span.sr-only
%contextual-extensions-menu{"ng-if" => "ctrl.showExtensions", "item" => "ctrl.note"} %contextual-extensions-menu{"ng-if" => "ctrl.showExtensions", "item" => "ctrl.note"}
.editor-content{"ng-class" => "{'fullscreen' : ctrl.fullscreen }"} .editor-content{"ng-if" => "ctrl.noteReady", "ng-class" => "{'fullscreen' : ctrl.fullscreen }"}
%iframe#editor-iframe{"ng-if" => "ctrl.customEditor", "ng-src" => "{{ctrl.customEditor.url | trusted}}", "frameBorder" => "0", "style" => "width: 100%;"} %iframe#editor-iframe{"ng-if" => "ctrl.customEditor", "ng-src" => "{{ctrl.customEditor.url | trusted}}", "frameBorder" => "0", "style" => "width: 100%;"}
%textarea.editable#note-text-editor{"ng-if" => "!ctrl.customEditor", "ng-class" => "{'fullscreen' : ctrl.fullscreen }", "ng-model" => "ctrl.note.text", %textarea.editable#note-text-editor{"ng-if" => "!ctrl.customEditor", "ng-class" => "{'fullscreen' : ctrl.fullscreen }", "ng-model" => "ctrl.note.text",
"ng-change" => "ctrl.contentChanged()", "ng-click" => "ctrl.clickedTextArea()", "ng-focus" => "ctrl.onContentFocus()"} "ng-change" => "ctrl.contentChanged()", "ng-click" => "ctrl.clickedTextArea()", "ng-focus" => "ctrl.onContentFocus()"}