File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 129
129
return CodeMirror . Pass ;
130
130
}
131
131
132
+ function clearInputFile ( editor ) {
133
+ var imageInput = editor . gui . toolbar . getElementsByClassName ( 'imageInput' ) [ 0 ] ;
134
+ imageInput . value = '' ;
135
+ }
136
+
132
137
function customUploadImage ( file , onSuccess , onError ) {
133
138
var self = this ;
134
139
var position = { } ;
135
140
136
141
onSuccess = function onSuccess ( jsonData ) {
137
142
updateMediaIDs ( self , jsonData ) ;
138
143
afterFileUploaded ( self , jsonData , position ) ;
144
+ clearInputFile ( self ) ;
139
145
} ;
140
146
141
147
onError = function onError ( errorMessage ) {
142
- showErrorMessage ( self , errorMessage )
148
+ showErrorMessage ( self , errorMessage ) ;
143
149
if ( position && position . start && position . end ) {
144
150
self . codemirror . replaceRange ( "" , position . start , position . end ) ;
145
151
}
152
+ clearInputFile ( self ) ;
146
153
}
147
154
148
155
function onErrorSup ( errorMessage ) {
You can’t perform that action at this time.
0 commit comments