misc: fix ajax-loading of empty cell (#9223)
This is a workaround for jQuery .replaceWith() not working with empty strings.
This commit is contained in:
parent
ffff0b7462
commit
f605f88185
|
@ -4,7 +4,13 @@ function combo_load_cell(elem, url) {
|
|||
async: true,
|
||||
dataType: 'html',
|
||||
crossDomain: true,
|
||||
success: function(data) { $(elem).replaceWith(data); },
|
||||
success: function(data) {
|
||||
if (data == '') {
|
||||
$(elem).remove();
|
||||
} else {
|
||||
$(elem).replaceWith(data);
|
||||
}
|
||||
},
|
||||
error: function(error) {
|
||||
$(elem).addClass('error-loading');
|
||||
window.console && console.log(':(', error);
|
||||
|
|
Loading…
Reference in New Issue