Make bookmarkMoved compatible with IE/Edge
This commit is contained in:
parent
42c0982a48
commit
e1339f3772
|
@ -93,19 +93,20 @@ function bookmarkMoved(dropEvt) {
|
|||
var db = openEvt.target.result;
|
||||
var groupsStore = db.transaction("Groups", "readwrite").objectStore("Groups");
|
||||
|
||||
groupsStore.getAll().onsuccess = function (getAllEvt) {
|
||||
var groups = getAllEvt.target.result;
|
||||
groupsStore.get(oldGroupIndex).onsuccess = function (getOldEvt) {
|
||||
var oldGroupData = getOldEvt.target.result;
|
||||
|
||||
var oldGroupData = groups[oldGroupIndex];
|
||||
var newGroupData = groups[newGroupIndex];
|
||||
groupsStore.get(newGroupIndex).onsuccess = function (getNewEvt) {
|
||||
var newGroupData = getNewEvt.target.result;
|
||||
|
||||
oldGroupData.bookmarks = removeFromArray(oldGroupData.bookmarks, oldIndex);
|
||||
groupsStore.put(oldGroupData);
|
||||
oldGroupData.bookmarks = removeFromArray(oldGroupData.bookmarks, oldIndex);
|
||||
groupsStore.put(oldGroupData);
|
||||
|
||||
newGroupData.bookmarks = addToArray(newGroupData.bookmarks, itemData, newIndex);
|
||||
groupsStore.put(newGroupData);
|
||||
newGroupData.bookmarks = addToArray(newGroupData.bookmarks, itemData, newIndex);
|
||||
groupsStore.put(newGroupData);
|
||||
|
||||
db.close();
|
||||
db.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue