Permalink
Browse files

Added method to focus editor pragmatically

  • Loading branch information...
1 parent acf03b6 commit b7a561655aebe97f648a4244b415aef6f960d71c Kevin committed Nov 1, 2012
Showing with 19 additions and 0 deletions.
  1. +7 −0 README.rst
  2. +12 −0 jquery.wysiwyg.js
View
@@ -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
@@ -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");

0 comments on commit b7a5616

Please sign in to comment.