Skip to content

Commit e00160a

Browse files
wymeditor: Replaces fixed selectors with variables
1 parent 309d86e commit e00160a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

system/wymeditor/plugins/image_upload/jquery.wymeditor.image_upload.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ WYMeditor.editor.prototype.image_upload = function() {
2727
var orig = d.initialize;
2828
d.initialize = function(wDialog) {
2929
orig.call(this, wDialog);
30-
var doc = wDialog.document;
30+
var wym = this,
31+
doc = wDialog.document,
32+
options = wym._options;
3133

3234
var oldSubmitLabel = jQuery("form#image_upload_form .submit", doc).val();
3335
// WYMEditor automatically locks onto any form here, so remove the binding.
@@ -43,8 +45,8 @@ WYMeditor.editor.prototype.image_upload = function() {
4345
if (response.error){
4446
alert(response.error);
4547
} else {
46-
jQuery(".wym_src", doc).val(response.thumbUrl);
47-
jQuery(".wym_alt", doc).val(response.original_filename);
48+
jQuery(options.srcSelector, doc).val(response.thumbUrl);
49+
jQuery(options.altSelector, doc).val(response.original_filename);
4850
}
4951
jQuery("form#image_upload_form .submit", doc).val(oldSubmitLabel);
5052
}

0 commit comments

Comments
 (0)