0001-Fix-jQuery.fn.attr-selected-might-use-property-inste.patch

Marius BALTEANU, 2019-08-13 22:08

Download (2.8 KB)

View differences:

app/views/users/new.html.erb
20 20
        $('input#user_mail').val(ui.item.mail);
21 21
        $('select#user_auth_source_id option').each(function(){
22 22
          if ($(this).attr('value') == ui.item.auth_source_id) {
23
            $(this).attr('selected', true);
23
            $(this).prop('selected', true);
24 24
            $('select#user_auth_source_id').trigger('change');
25 25
          }
26 26
        });
public/javascripts/application.js
177 177
  select = tr.find('td.operator select');
178 178
  for (i = 0; i < operators.length; i++) {
179 179
    var option = $('<option>').val(operators[i]).text(operatorLabels[operators[i]]);
180
    if (operators[i] == operator) { option.attr('selected', true); }
180
    if (operators[i] == operator) { option.prop('selected', true); }
181 181
    select.append(option);
182 182
  }
183 183
  select.change(function(){ toggleOperator(field); });
......
198 198
      var option = $('<option>');
199 199
      if ($.isArray(filterValue)) {
200 200
        option.val(filterValue[1]).text(filterValue[0]);
201
        if ($.inArray(filterValue[1], values) > -1) {option.attr('selected', true);}
201
        if ($.inArray(filterValue[1], values) > -1) {option.prop('selected', true);}
202 202
        if (filterValue.length == 3) {
203 203
          var optgroup = select.find('optgroup').filter(function(){return $(this).attr('label') == filterValue[2]});
204 204
          if (!optgroup.length) {optgroup = $('<optgroup>').attr('label', filterValue[2]);}
......
206 206
        }
207 207
      } else {
208 208
        option.val(filterValue).text(filterValue);
209
        if ($.inArray(filterValue, values) > -1) {option.attr('selected', true);}
209
        if ($.inArray(filterValue, values) > -1) {option.prop('selected', true);}
210 210
      }
211 211
      select.append(option);
212 212
    }
......
240 240
      var filterValue = filterValues[i];
241 241
      var option = $('<option>');
242 242
      option.val(filterValue[1]).text(filterValue[0]);
243
      if (values[0] == filterValue[1]) { option.attr('selected', true); }
243
      if (values[0] == filterValue[1]) { option.prop('selected', true); }
244 244
      select.append(option);
245 245
    }
246 246
    break;
247
-