File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -404,8 +404,8 @@ export default class RichTextEditor extends Component {
404
404
this . _sendAction ( actions . updateLink , { url, title} ) ;
405
405
}
406
406
407
- insertImage ( url , alt ) {
408
- this . _sendAction ( actions . insertImage , { url , alt } ) ;
407
+ insertImage ( attributes ) {
408
+ this . _sendAction ( actions . insertImage , attributes ) ;
409
409
this . prepareInsert ( ) ; //This must be called BEFORE insertImage. But WebViewBridge uses a stack :/
410
410
}
411
411
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export const InjectedMessageHandler = `
77
77
zss_editor.updateLink(action.data.url, action.data.title);
78
78
break;
79
79
case '${ actions . insertImage } ':
80
- zss_editor.insertImage(action.data.url, action.data.alt );
80
+ zss_editor.insertImage(action.data);
81
81
break;
82
82
case '${ actions . setSubscript } ':
83
83
zss_editor.setSubscript();
Original file line number Diff line number Diff line change 1332
1332
zss_editor . backuprange ( ) ;
1333
1333
}
1334
1334
1335
- zss_editor . insertImage = function ( url , alt ) {
1335
+ zss_editor . insertImage = function ( attributes ) {
1336
1336
zss_editor . restorerange ( ) ;
1337
- var html = '<img src="' + encodeHtmlEntities ( url ) + '" alt="' + encodeHtmlEntities ( alt ) + '" /><br>' ;
1338
- zss_editor . insertHTML ( html ) ;
1337
+ var imageContainer = $ ( '<div><img></div>' ) ;
1338
+ imageContainer . find ( 'img' ) . attr ( attributes ) ;
1339
+ zss_editor . insertHTML ( imageContainer . html ( ) + '<br>' ) ;
1339
1340
zss_editor . enabledEditingItems ( ) ;
1340
1341
}
1341
1342
You can’t perform that action at this time.
0 commit comments