Projet

Général

Profil

0001-misc-fix-ajax-loading-of-empty-cell-9223.patch

Frédéric Péters, 07 décembre 2015 08:53

Télécharger (1,19 ko)

Voir les différences:

Subject: [PATCH] misc: fix ajax-loading of empty cell (#9223)

This is a workaround for jQuery .replaceWith() not working with empty strings.
 combo/public/static/js/combo.public.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
combo/public/static/js/combo.public.js
4 4
          async: true,
5 5
          dataType: 'html',
6 6
          crossDomain: true,
7
          success: function(data) { $(elem).replaceWith(data); },
7
          success: function(data) {
8
              if (data == '') {
9
                  $(elem).remove();
10
              } else {
11
                  $(elem).replaceWith(data);
12
              }
13
          },
8 14
          error: function(error) {
9 15
              $(elem).addClass('error-loading');
10 16
              window.console && console.log(':(', error);
11
-