File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -167,12 +167,27 @@ export default {
167
167
else if (range && ! oldRange) this .$emit (" focus" , this .quill );
168
168
},
169
169
170
- handleTextChange () {
170
+ handleTextChange (delta , oldContents ) {
171
171
let editorContent =
172
172
this .quill .getHTML () === " <p><br></p>" ? " " : this .quill .getHTML ();
173
173
this .$emit (" input" , editorContent);
174
+
175
+ if (this .useCustomImageHandler )
176
+ this .handleImageRemoved (delta, oldContents);
174
177
},
175
178
179
+ handleImageRemoved (delta , oldContents ) {
180
+ const currrentContents = this .quill .getContents ();
181
+ const deletedContents = currrentContents .diff (oldContents);
182
+ const operations = deletedContents .ops ;
183
+
184
+ operations .map (operation => {
185
+ if (operation .insert && operation .insert .hasOwnProperty (" image" )) {
186
+ const { image } = operation .insert ;
187
+ this .$emit (" imageRemoved" , image);
188
+ }
189
+ });
190
+ },
176
191
checkForCustomImageHandler () {
177
192
this .useCustomImageHandler === true ? this .setupCustomImageHandler () : " " ;
178
193
},
You can’t perform that action at this time.
0 commit comments