Make populateGroupList compatible with IE/Edge

This commit is contained in:
Neil Brommer 2018-01-02 20:27:47 -08:00
parent a83d415f48
commit 42c0982a48

View file

@ -16,17 +16,16 @@ function populateGroupList() {
var db = openEvt.target.result; var db = openEvt.target.result;
var groupsStore = db.transaction("Groups", "readwrite").objectStore("Groups"); var groupsStore = db.transaction("Groups", "readwrite").objectStore("Groups");
groupsStore.getAll().onsuccess = function (getAllEvt) { groupsStore.openCursor().onsuccess = function (cursorEvt) {
var groups = getAllEvt.target.result; var cursor = cursorEvt.target.result;
if (cursor) {
for (let group of groups) { var group = cursor.value;
combo.append($("<option>") combo.append($("<option>")
.attr({ "value": group.groupIndex }) .attr({ "value": group.groupIndex })
.text(group.title)); .text(group.title));
}
$("#createGroup").prop("required", true); cursor.continue();
db.close(); }
} }
} }