Changeset 6015
- Timestamp:
- 08/25/07 18:33:58 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/admin/media/js/SelectBox.js
r450 r6015 7 7 var cache = SelectBox.cache[id]; 8 8 for (var i = 0; (node = box.options[i]); i++) { 9 cache.push({ value: node.value, text: node.text, displayed: 1});9 cache.push({value: node.value, text: node.text, displayed: 1}); 10 10 } 11 11 }, … … 51 51 }, 52 52 add_to_cache: function(id, option) { 53 SelectBox.cache[id].push({ value: option.value, text: option.text, displayed: 1});53 SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); 54 54 }, 55 55 cache_contains: function(id, value) { … … 69 69 for (var i = 0; (option = from_box.options[i]); i++) { 70 70 if (option.selected && SelectBox.cache_contains(from, option.value)) { 71 SelectBox.add_to_cache(to, { value: option.value, text: option.text, displayed: 1});71 SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); 72 72 SelectBox.delete_from_cache(from, option.value); 73 73 } … … 81 81 var option; 82 82 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 } 85 87 } 86 88 SelectBox.redisplay(from);
