Skip to content

Commit

Permalink
Merge pull request #268 from bigcartel/master
Browse files Browse the repository at this point in the history
Adds a public method to get the current selection
  • Loading branch information
akzhan committed Jan 12, 2012
2 parents 0ae7326 + cfcc8c8 commit a5252c9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jquery.wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit a5252c9

Please sign in to comment.