diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 7e18b0fc4..c26ffd64a 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -111,7 +111,7 @@
- - Edit
+ - Edit
- Preview
- History
@@ -229,7 +229,11 @@
editor.setTheme("ace/theme/github");
editor.getSession().setMode("ace/mode/markdown");
editor.getSession().setValue(window.wiki_page_content);
-
+ window.editor = editor; // Store the editor in the window object so the anonymous function can use it.
+ $('#edit-pane-tab').click(function (ev) {
+ setTimeout(function() {window.editor.focus();}, 500); // Return the focus to the editor allowing immediate text entry
+ });
+
$('#wiki-get-preview').click(function (ev) {
$.post("wiki/{{$channel}}/preview", {content: editor.getValue(), resource_id: window.wiki_resource_id}, function (data) {
if (data.success) {