Skip to content

Commit

Permalink
Release 0.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kmoe committed Aug 21, 2015
1 parent b4c65bc commit 637d32e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
29 changes: 16 additions & 13 deletions dist/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -8798,7 +8798,8 @@ Delta = Quill.require('delta');

Keyboard = (function() {
Keyboard.DEFAULTS = {
'tabToIndent': true
'tabToIndent': true,
'disableEnter': false
};

Keyboard.hotkeys = {
Expand Down Expand Up @@ -8893,19 +8894,21 @@ Keyboard = (function() {
return this.addHotkey(keys, (function(_this) {
return function(range, hotkey) {
var delta, leaf, line, offset, ref, ref1;
if (range == null) {
return true;
}
ref = _this.quill.editor.doc.findLineAt(range.start), line = ref[0], offset = ref[1];
ref1 = line.findLeafAt(offset), leaf = ref1[0], offset = ref1[1];
delta = new Delta().retain(range.start).insert('\n', line.formats)["delete"](range.end - range.start);
_this.quill.updateContents(delta, Quill.sources.USER);
_.each(leaf.formats, function(value, format) {
_this.quill.prepareFormat(format, value);
if (_this.toolbar != null) {
_this.toolbar.setActive(format, value);
if (!_this.options.disableEnter) {
if (range == null) {
return true;
}
});
ref = _this.quill.editor.doc.findLineAt(range.start), line = ref[0], offset = ref[1];
ref1 = line.findLeafAt(offset), leaf = ref1[0], offset = ref1[1];
delta = new Delta().retain(range.start).insert('\n', line.formats)["delete"](range.end - range.start);
_this.quill.updateContents(delta, Quill.sources.USER);
_.each(leaf.formats, function(value, format) {
_this.quill.prepareFormat(format, value);
if (_this.toolbar != null) {
_this.toolbar.setActive(format, value);
}
});
}
return false;
};
})(this));
Expand Down
Loading

0 comments on commit 637d32e

Please sign in to comment.