Ticket #348: 348.diff

File 348.diff, 889 bytes (added by Gary Wilson <gary.wilson@…>, 17 years ago)
  • django/contrib/admin/media/js/SelectBox.js

     
    8080        var to_box = document.getElementById(to);
    8181        var option;
    8282        for (var i = 0; (option = from_box.options[i]); i++) {
    83             SelectBox.add_to_cache(to, { value: option.value, text: option.text, displayed: 1 });
    84             SelectBox.delete_from_cache(from, option.value);
     83            if (SelectBox.cache_contains(from, option.value)) {
     84                SelectBox.add_to_cache(to, { value: option.value, text: option.text, displayed: 1 });
     85                SelectBox.delete_from_cache(from, option.value);
     86            }
    8587        }
    8688        SelectBox.redisplay(from);
    8789        SelectBox.redisplay(to);
Back to Top