From 6be2c418231684d165f876c547e7abd3112e4960 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 18 May 2017 16:47:27 +0300 Subject: [PATCH] fix(edit-file) show editor when access denied --- client/modules/edit-file-vim.js | 2 ++ client/modules/edit-file.js | 6 +++++- client/modules/edit-names.js | 2 ++ client/modules/edit.js | 1 - 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/modules/edit-file-vim.js b/client/modules/edit-file-vim.js index 0002fb8f..1e0700fa 100644 --- a/client/modules/edit-file-vim.js +++ b/client/modules/edit-file-vim.js @@ -1,5 +1,7 @@ 'use strict'; +/* global CloudCmd */ + const exec = require('execon'); const Key = CloudCmd.Key; diff --git a/client/modules/edit-file.js b/client/modules/edit-file.js index 8913c6a5..857fc74d 100644 --- a/client/modules/edit-file.js +++ b/client/modules/edit-file.js @@ -65,7 +65,9 @@ CloudCmd.EditFile = function EditFileProto(callback) { Images.show.load(); - CloudCmd.Edit.show(config); + CloudCmd.Edit + .getEditor() + .setOption('keyMap', 'default'); Info.getData((error, data) => { const path = Info.path; @@ -81,6 +83,8 @@ CloudCmd.EditFile = function EditFileProto(callback) { .setValueFirst(path, data) .setModeForPath(name) .enableKey(); + + CloudCmd.Edit.show(config); }); return CloudCmd.Edit; diff --git a/client/modules/edit-names.js b/client/modules/edit-names.js index d1d09664..5ea8f286 100644 --- a/client/modules/edit-names.js +++ b/client/modules/edit-names.js @@ -58,9 +58,11 @@ CloudCmd.EditNames = function EditNamesProto(callback) { .getEditor() .setValueFirst('edit-names', names) .setMode() + .setOption('keyMap', 'default') .disableKey(); DOM.Events.addKey(keyListener); + CloudCmd.Edit.show(ConfigView); }; diff --git a/client/modules/edit.js b/client/modules/edit.js index d78252d9..52a6bc19 100644 --- a/client/modules/edit.js +++ b/client/modules/edit.js @@ -87,7 +87,6 @@ function EditProto(callback) { Edit.getEditor() .setOptions({ - keyMap: 'default', fontSize: 16, });