Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added method to focus editor pragmatically

  • Loading branch information...
commit b7a561655aebe97f648a4244b415aef6f960d71c 1 parent acf03b6
Kevin authored
Showing with 19 additions and 0 deletions.
  1. +7 −0 README.rst
  2. +12 −0 jquery.wysiwyg.js
View
7 README.rst
@@ -132,6 +132,13 @@ To clear the editor at any time::
$('#wysiwyg').wysiwyg('clear');
+Focus the Editor
+----------------
+
+To focus on the editor at any time::
+
+ $('#wysiwyg').wysiwyg('focus');
+
Insert an Image
---------------
View
12 jquery.wysiwyg.js
@@ -1931,6 +1931,18 @@ html: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.o
return $(oWysiwyg.editorDoc);
},
+ focus: function(object) {
+ var oWysiwyg = object.data("wysiwyg");
+
+ if (!oWysiwyg) {
+ return undefined;
+ }
+
+ oWysiwyg.ui.focus();
+
+ return object;
+ },
+
getContent: function (object) {
// no chains because of return
var oWysiwyg = object.data("wysiwyg");
Please sign in to comment.
Something went wrong with that request. Please try again.