File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ interface Quill {
1313interface QuillResizeImageOptions {
1414 [ index : string ] : any ;
1515 locale ?: Locale ;
16+ disableMediaTypes ?: {
17+ disableImages ?: boolean ;
18+ disableVideos ?: boolean ;
19+ disableIframes ?: boolean ;
20+ } ;
1621 keepAspectRatio ?: boolean ;
1722}
1823
@@ -31,7 +36,10 @@ function QuillResizeImage(quill: Quill, options?: QuillResizeImageOptions) {
3136 const target : HTMLElement = e . target as HTMLElement ;
3237 if (
3338 e . target &&
34- [ "img" , "video" ] . includes ( target . tagName . toLowerCase ( ) ) &&
39+ [
40+ ! options ?. disableMediaTypes ?. disableImages && "img" ,
41+ ! options ?. disableMediaTypes ?. disableVideos && "video" ,
42+ ] . includes ( target . tagName . toLowerCase ( ) ) &&
3543 quill . isEnabled ( )
3644 ) {
3745 resizeTarge = target ;
@@ -49,7 +57,7 @@ function QuillResizeImage(quill: Quill, options?: QuillResizeImageOptions) {
4957
5058 quill . on ( "text-change" , ( delta : any , source : string ) => {
5159 // iframe 大小调整
52- if ( quill . isEnabled ( ) ) {
60+ if ( ! options ?. disableMediaTypes ?. disableIframes && quill . isEnabled ( ) ) {
5361 container
5462 . querySelectorAll ( "iframe" )
5563 . forEach ( ( item : HTMLIFrameElement ) => {
You can’t perform that action at this time.
0 commit comments