@@ -50,7 +50,7 @@ const LinkType = Base.extend({
5050 "data-val" : this . value ( ) ,
5151 } ;
5252 } ,
53- updateRelatedItems : function ( ) { } ,
53+ updateRelatedItems : function ( ) { } ,
5454} ) ;
5555
5656const ExternalLink = LinkType . extend ( {
@@ -94,20 +94,25 @@ const InternalLink = LinkType.extend({
9494 return this . el . querySelector ( "input" ) ;
9595 } ,
9696
97- createContentBrowser : async function ( ) {
97+ contentBrowserOptions : function ( ) {
9898 const options = {
9999 selection : [ ] ,
100100 ...this . linkModal . options ?. relatedItems ,
101101 } ;
102102 options [ "maximum-selection-size" ] = 1 ;
103103 // enable upload in ContentBrowser instead of separate tab
104104 options [ "upload" ] = 1 ;
105- const inputEl = this . getEl ( ) ;
106105 const element = this . tiny . selection . getNode ( ) ;
107106 const linkType = this . tiny . dom . getAttrib ( element , "data-linktype" ) ;
108107 if ( linkType === "internal" || linkType === "image" ) {
109108 options . selection . push ( this . tiny . dom . getAttrib ( element , "data-val" ) ) ;
110109 }
110+ return options ;
111+ } ,
112+
113+ createContentBrowser : async function ( ) {
114+ const inputEl = this . getEl ( ) ;
115+ const options = this . contentBrowserOptions ( ) ;
111116 const ContentBrowser = ( await import ( "../../contentbrowser/contentbrowser" ) )
112117 . default ;
113118 this . contentBrowserPattern = new ContentBrowser ( inputEl , options ) ;
@@ -125,6 +130,13 @@ const InternalLink = LinkType.extend({
125130const ImageLink = InternalLink . extend ( {
126131 name : "imagelinktype" ,
127132 trigger : ".pat-imagelinktype-dummy" ,
133+
134+ contentBrowserOptions : function ( ) {
135+ const options = InternalLink . prototype . contentBrowserOptions . call ( this ) ;
136+ options [ "uploadAcceptedMimetypes" ] = "image/*" ;
137+ return options ;
138+ } ,
139+
128140 toUrl : function ( ) {
129141 const value = this . value ( ) ;
130142 return this . tinypattern . generateImageUrl (
0 commit comments