|
1 | 1 | /*!
|
2 |
| - * vue2-editor v2.9.1 |
| 2 | + * vue2-editor v2.10.0 |
3 | 3 | * (c) 2019 David Royer
|
4 | 4 | * Released under the MIT License.
|
5 | 5 | */
|
|
691 | 691 | handleSelectionChange: function handleSelectionChange(range, oldRange) {
|
692 | 692 | if (!range && oldRange) this.$emit("blur", this.quill);else if (range && !oldRange) this.$emit("focus", this.quill);
|
693 | 693 | },
|
694 |
| - handleTextChange: function handleTextChange() { |
| 694 | + handleTextChange: function handleTextChange(delta, oldContents) { |
695 | 695 | var editorContent = this.quill.getHTML() === "<p><br></p>" ? "" : this.quill.getHTML();
|
696 | 696 | this.$emit("input", editorContent);
|
| 697 | + if (this.useCustomImageHandler) this.handleImageRemoved(delta, oldContents); |
| 698 | + }, |
| 699 | + handleImageRemoved: function handleImageRemoved(delta, oldContents) { |
| 700 | + var _this2 = this; |
| 701 | + |
| 702 | + var currrentContents = this.quill.getContents(); |
| 703 | + var deletedContents = currrentContents.diff(oldContents); |
| 704 | + var operations = deletedContents.ops; |
| 705 | + operations.map(function (operation) { |
| 706 | + if (operation.insert && operation.insert.hasOwnProperty("image")) { |
| 707 | + var image = operation.insert.image; |
| 708 | + |
| 709 | + _this2.$emit("imageRemoved", image); |
| 710 | + } |
| 711 | + }); |
697 | 712 | },
|
698 | 713 | checkForCustomImageHandler: function checkForCustomImageHandler() {
|
699 | 714 | this.useCustomImageHandler === true ? this.setupCustomImageHandler() : "";
|
|
836 | 851 | undefined
|
837 | 852 | );
|
838 | 853 |
|
839 |
| - var version = "2.9.1"; // Declare install function executed by Vue.use() |
| 854 | + var version = "2.10.0"; // Declare install function executed by Vue.use() |
840 | 855 |
|
841 | 856 | function install(Vue) {
|
842 | 857 | if (install.installed) return;
|
|
0 commit comments