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,
|
async: true,
|
||||||
dataType: 'html',
|
dataType: 'html',
|
||||||
crossDomain: true,
|
crossDomain: true,
|
||||||
success: function(data) { $(elem).replaceWith(data); },
|
success: function(data) {
|
||||||
|
if (data == '') {
|
||||||
|
$(elem).remove();
|
||||||
|
} else {
|
||||||
|
$(elem).replaceWith(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
error: function(error) {
|
error: function(error) {
|
||||||
$(elem).addClass('error-loading');
|
$(elem).addClass('error-loading');
|
||||||
window.console && console.log(':(', error);
|
window.console && console.log(':(', error);
|
||||||
|
|
Loading…
Reference in New Issue