Spellcheck toggle option

This commit is contained in:
Mo Bitar
2018-01-20 19:36:45 -06:00
parent 3bce8ec82d
commit c3bb993075
3 changed files with 13 additions and 9 deletions

View File

@@ -25,6 +25,7 @@ angular.module('app')
})
.controller('EditorCtrl', function ($sce, $timeout, authManager, $rootScope, actionsManager, syncManager, modelManager, themeManager, componentManager, storageManager) {
this.spellcheck = true;
this.componentManager = componentManager;
this.componentStack = [];
@@ -247,13 +248,6 @@ angular.module('app')
this.editingName = false;
}
this.toggleFullScreen = function() {
this.fullscreen = !this.fullscreen;
if(this.fullscreen) {
this.focusEditor(0);
}
}
this.selectedMenuItem = function($event, hide) {
if(hide) {
this.showMenu = false;
@@ -365,6 +359,7 @@ angular.module('app')
this.loadPreferences = function() {
this.monospaceFont = authManager.getUserPrefValue("monospaceFont", "monospace");
this.spellcheck = authManager.getUserPrefValue("spellcheck", true);
if(!document.getElementById("editor-content")) {
// Elements have not yet loaded due to ng-if around wrapper
@@ -406,6 +401,14 @@ angular.module('app')
this[key] = !this[key];
authManager.setUserPrefValue(key, this[key], true);
this.reloadFont();
if(key == "spellcheck") {
// Allows textarea to reload
this.noteReady = false;
$timeout(() => {
this.noteReady = true;
}, 0)
}
}

View File

@@ -15,7 +15,6 @@ class SysExtManager {
this.singletonManager.registerSingleton({content_type: "SN|Component", package_info: {identifier: extensionsIdentifier}}, (resolvedSingleton) => {
// Resolved Singleton
console.log("Resolved extensions-manager", resolvedSingleton);
var needsSync = false;
if(isDesktopApplication()) {
if(!resolvedSingleton.local_url) {

View File

@@ -30,6 +30,7 @@
.header
%h4.title Display
%menu-row{"title" => "'Monospace Font'", "circle" => "ctrl.monospaceFont ? 'success' : 'default'", "ng-click" => "ctrl.selectedMenuItem($event, true); ctrl.toggleKey('monospaceFont')"}
%menu-row{"title" => "'Spellcheck'", "circle" => "ctrl.spellcheck ? 'success' : 'default'", "ng-click" => "ctrl.selectedMenuItem($event, true); ctrl.toggleKey('spellcheck')"}
.item{"ng-click" => "ctrl.onEditorMenuClick()", "ng-class" => "{'selected' : ctrl.showEditorMenu}", "click-outside" => "ctrl.showEditorMenu = false;", "is-open" => "ctrl.showEditorMenu"}
.label Editor
@@ -43,7 +44,8 @@
%panel-resizer.left{"panel-id" => "'editor-content'", "on-resize-finish" => "ctrl.onPanelResizeFinish","control" => "ctrl.resizeControl", "min-width" => 300, "property" => "'left'", "hoverable" => "true"}
%component-view.component-view{"ng-if" => "ctrl.selectedEditor", "component" => "ctrl.selectedEditor"}
%textarea.editable#note-text-editor{"ng-if" => "!ctrl.selectedEditor", "ng-model" => "ctrl.note.text",
"ng-change" => "ctrl.contentChanged()", "ng-trim" => "false", "ng-click" => "ctrl.clickedTextArea()", "ng-focus" => "ctrl.onContentFocus()", "dir" => "auto"}
"ng-change" => "ctrl.contentChanged()", "ng-trim" => "false", "ng-click" => "ctrl.clickedTextArea()",
"ng-focus" => "ctrl.onContentFocus()", "dir" => "auto", "ng-attr-spellcheck" => "{{ctrl.spellcheck}}"}
{{ctrl.onSystemEditorLoad()}}
%panel-resizer{"panel-id" => "'editor-content'", "on-resize-finish" => "ctrl.onPanelResizeFinish","control" => "ctrl.resizeControl", "min-width" => 300, "hoverable" => "true"}