Skip to content

Commit

Permalink
Merge pull request #11 from donnanicolas/master
Browse files Browse the repository at this point in the history
Added support for $('...').caret('pos', 0)
  • Loading branch information
ichord committed Feb 24, 2014
2 parents 2f766a9 + 2de2b0f commit 981db31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/jquery.caret.coffee
Expand Up @@ -226,7 +226,10 @@

methods =
pos: (pos) ->
if pos then this.setPos pos else this.getPos()
if pos or pos == 0
this.setPos pos
else
this.getPos()

position: (pos) ->
if oDocument.selection then this.getIEPosition pos else this.getPosition pos
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.caret.js
Expand Up @@ -290,7 +290,7 @@
};
methods = {
pos: function(pos) {
if (pos) {
if (pos || pos === 0) {
return this.setPos(pos);
} else {
return this.getPos();
Expand Down

0 comments on commit 981db31

Please sign in to comment.