Skip to content

Commit

Permalink
Hopefully, this clears the lis properly (untested).
Browse files Browse the repository at this point in the history
  • Loading branch information
skytreader committed Mar 12, 2016
1 parent 35ffdda commit 8f4a7d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions librarian/static/scripts/add-books/main.js
Expand Up @@ -184,12 +184,10 @@ function renderContentCreatorListing(creatorType){
var hiddenLastnameProxy = document.createElement("input");
hiddenLastnameProxy.type = "hidden";
hiddenLastnameProxy.name = creatorType + "-proxy-lastname";
console.info("created hidden field with name", hiddenLastnameProxy.name);

var hiddenFirstnameProxy = document.createElement("input");
hiddenFirstnameProxy.type = "hidden";
hiddenFirstnameProxy.name = creatorType + "-proxy-firstname";
console.info("created hidden field with name", hiddenFirstnameProxy.name);

var divRow = document.createElement("div");
$(divRow).addClass("row");
Expand Down Expand Up @@ -347,6 +345,15 @@ function loadToForm(reqData){
insertAllCreators(reqData.translators, "translator");
}

/**
Clear all the user listings of their children li elements.
*/
function clearLists(){
for(var i = 0; i < CREATORS.length; i++){
$("#" + CREATORS[i] + "-list").empty();
}
}

$.validator.addMethod("isbnVal", function(value, element, param){
var stripped = stripExtraneous(value);
return verifyISBN10(stripped) || verifyISBN13(stripped);
Expand Down Expand Up @@ -451,6 +458,7 @@ $(document).ready(function(){
window.visualQueue.prepend(spine);
updateStatCounts();
clearProxyForm();
clearLists();
}
});

Expand Down

0 comments on commit 8f4a7d7

Please sign in to comment.