summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hoppe <info@johanneshoppe.com>2019-11-25 19:35:20 +0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-25 13:35:20 +0100
commitef93fd4683645635d3597e17c23f9ed862dd716b (patch)
treee0b907539027e6668c3b6766bb66365a1505f765
parent0290e01d5a202507e9a71294ac9cb31725c951bb (diff)
Fixed #31013 -- Removed jQuery usage in SelectBox.js.
-rw-r--r--django/contrib/admin/static/admin/js/SelectBox.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/django/contrib/admin/static/admin/js/SelectBox.js b/django/contrib/admin/static/admin/js/SelectBox.js
index 2073f03dd8..37aa702963 100644
--- a/django/contrib/admin/static/admin/js/SelectBox.js
+++ b/django/contrib/admin/static/admin/js/SelectBox.js
@@ -1,4 +1,4 @@
-(function($) {
+(function() {
'use strict';
var SelectBox = {
cache: {},
@@ -18,8 +18,7 @@
// Repopulate HTML select box from cache
var box = document.getElementById(id);
var node;
- $(box).empty(); // clear all options
- var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag
+ box.innerHTML = '';
var cache = SelectBox.cache[id];
for (var i = 0, j = cache.length; i < j; i++) {
node = cache[i];
@@ -27,11 +26,9 @@
var new_option = new Option(node.text, node.value, false, false);
// Shows a tooltip when hovering over the option
new_option.setAttribute("title", node.text);
- new_options += new_option.outerHTML;
+ box.appendChild(new_option);
}
}
- new_options += '</select>';
- box.outerHTML = new_options;
},
filter: function(id, text) {
// Redisplay the HTML select box, displaying only the choices containing ALL
@@ -141,4 +138,4 @@
}
};
window.SelectBox = SelectBox;
-})(django.jQuery);
+})();