diff options
Diffstat (limited to 'assets/js/components')
-rw-r--r-- | assets/js/components/suggest-menu.js | 1 | ||||
-rw-r--r-- | assets/js/components/text-editor.js | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/assets/js/components/suggest-menu.js b/assets/js/components/suggest-menu.js index 22a58787..63a7551c 100644 --- a/assets/js/components/suggest-menu.js +++ b/assets/js/components/suggest-menu.js @@ -55,7 +55,6 @@ KB.component('suggest-menu', function(containerElement, options) { var lines = element.value.substring(0, element.selectionEnd).split("\n"); var lastLine = lines[lines.length - 1]; var words = lastLine.split(' '); - console.log(words); return words[words.length - 1]; } diff --git a/assets/js/components/text-editor.js b/assets/js/components/text-editor.js index 9b4be55c..8b601c01 100644 --- a/assets/js/components/text-editor.js +++ b/assets/js/components/text-editor.js @@ -10,6 +10,10 @@ KB.component('text-editor', function (containerElement, options) { .add(viewModeElement) .add(writeModeElement) .build()); + + if (options.autofocus) { + textarea.focus(); + } }; function buildViewMode() { @@ -50,7 +54,6 @@ KB.component('text-editor', function (containerElement, options) { .attr('name', options.name) .attr('tabindex', options.tabindex || '-1') .attr('required', options.required || false) - .attr('autofocus', options.autofocus || null) .text(options.text) // Order is important for IE11 .attr('placeholder', options.placeholder || null) .build(); |