Skip to content

Commit

Permalink
Don't try to remove the hidden id input more than once.
Browse files Browse the repository at this point in the history
  • Loading branch information
eggpi committed Aug 2, 2018
1 parent e151e5c commit b4dd77c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/js/category_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ function CategoryFilter() {

var cin = document.getElementById("category-input");
var chi = document.getElementById("hidden-category-input");
var ihi = document.getElementById("hidden-id-input");

var xhr = null;
var xhrCounter = 0;
Expand Down Expand Up @@ -191,7 +190,8 @@ function CategoryFilter() {
}

function setHiddenCategoryAndNextId(formElem, nextCategoryId) {
if (chi.value !== nextCategoryId) {
var ihi = document.getElementById("hidden-id-input");
if (ihi !== null && chi.value !== nextCategoryId) {
formElem.removeChild(ihi);
}
chi.value = nextCategoryId;
Expand Down

0 comments on commit b4dd77c

Please sign in to comment.