Skip to content

Commit

Permalink
Merge pull request danielearwicker#26 from creately/set-carot-by-point
Browse files Browse the repository at this point in the history
Set carot by point
  • Loading branch information
ramishka authored Jun 14, 2019
2 parents e2a3fd9 + d6bad59 commit 1c646cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@creately/carota",
"author": "Daniel Earwicker ([email protected])",
"description": "Simple, flexible rich text rendering/editing on HTML Canvas",
"version": "2.4.5",
"version": "2.5.0",
"repository": {
"type": "git",
"url": "https://github.com/danielearwicker/carota.git"
Expand Down
4 changes: 4 additions & 0 deletions src/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ var prototype = node.derive({
selectAll: function(){
this.select( 0, this.frame.length - 1, true );
},
moveCaretToPoint: function( point ){
var node = this.byCoordinate( point.x, point.y );
this.select( node.ordinal, node.ordinal, true );
},
moveCaretToEnd: function(){
this.select( this.frame.length - 1, this.frame.length - 1, true );
},
Expand Down

0 comments on commit 1c646cf

Please sign in to comment.