Skip to content
Browse files

Add a public method to get the current selection.

  • Loading branch information...
1 parent 0ae7326 commit d1086f9570903ec02136ab2babf047259de1fe4a Matt Wigham committed Jan 11, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 jquery.wysiwyg.js
View
11 jquery.wysiwyg.js
@@ -1903,6 +1903,17 @@ html: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.o
return oWysiwyg.getContent();
},
+
+ getSelection: function (object) {
+ // no chains because of return
+ var oWysiwyg = object.data("wysiwyg");
+
+ if (!oWysiwyg) {
+ return undefined;
+ }
+
+ return oWysiwyg.getRangeText();
+ },
init: function (object, options) {
return object.each(function () {

0 comments on commit d1086f9

Please sign in to comment.
Something went wrong with that request. Please try again.