Skip to content

Instantly share code, notes, and snippets.

@mikeknoop mikeknoop/example.js
Last active Dec 15, 2015

Embed
What would you like to do?
setCaret: function($el) {
var caret, lastCaret,
_this = this;
if (_.any(this.NO_CARET_TYPES, function(type) {
return type === _this.model.get('type');
})) {
return;
}
lastCaret = this.getCaret();
if (($el != null ? $el[0] : void 0) != null) {
caret = $el.atCaret('getCaretPosition');
}
this.model.set({
caret: caret,
lastCaret: lastCaret
});
if (caret != null) {
$el.attr('data-caret', caret);
}
if (lastCaret != null) {
return $el.attr('data-last-caret', lastCaret);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.