diff --git a/public/src/forum/admin/categories.js b/public/src/forum/admin/categories.js index 455bc17d79..144adfd26a 100644 --- a/public/src/forum/admin/categories.js +++ b/public/src/forum/admin/categories.js @@ -252,6 +252,7 @@ define(['uploader'], function(uploader) { var numResults = results.length, resultObj; + resultsEl.html(''); for(var x = 0; x < numResults; x++) { resultObj = results[x]; liEl = $('
  • ') @@ -348,12 +349,14 @@ define(['uploader'], function(uploader) { readMembers = modalEl.find('#category-permissions-read'), writeMembers = modalEl.find('#category-permissions-write'), moderatorsEl = modalEl.find('#category-permissions-mods'); + socket.emit('admin.categories.getPrivilegeSettings', cid, function(err, privilegeList) { var readLength = privilegeList['+r'].length, writeLength = privilegeList['+w'].length, modLength = privilegeList['mods'].length, liEl, x, userObj; + readMembers.html(''); if (readLength > 0) { for(x = 0; x < readLength; x++) { userObj = privilegeList['+r'][x]; @@ -365,10 +368,11 @@ define(['uploader'], function(uploader) { readMembers.append(liEl); } + writeMembers.html(''); if (writeLength > 0) { for(x=0;x').attr('data-uid', userObj.uid).html(''); + liEl = $('
  • ').attr('data-uid', userObj.uid).html(''); writeMembers.append(liEl); } } else { @@ -376,6 +380,7 @@ define(['uploader'], function(uploader) { writeMembers.append(liEl); } + moderatorsEl.html(''); if (modLength > 0) { for(x = 0;x < modLength; x++) { userObj = privilegeList['mods'][x]; @@ -384,7 +389,7 @@ define(['uploader'], function(uploader) { } } else { liEl = $('
  • ').addClass('empty').html('No moderators'); - moderatorsEl.appendChild(liEl); + moderatorsEl.append(liEl); } }); };