Skip to content
Permalink
Browse files

archive economy entries

  • Loading branch information...
Manuel-777 committed May 7, 2019
1 parent 6cca1f6 commit 681effc325cec4db71bb540f22f7b190288e14a0
Showing with 33 additions and 1 deletion.
  1. +8 −0 window_background/background.js
  2. +24 −0 window_main/economy.js
  3. +1 −1 window_main/index.css
@@ -447,6 +447,14 @@ ipc.on("delete_match", function(event, arg) {
ipc_send("hide_loading");
});

//
ipc.on("archive_economy", function(event, _id) {
ipc_send("show_loading");
economy[_id].archived = true;
store.set(_id, economy[_id]);
ipc_send("hide_loading");
});

//
ipc.on("request_events", () => {
ipc_send("set_events", JSON.stringify(events));
@@ -14,6 +14,7 @@ global
get_set_scryfall,
getReadableEvent,
hideLoadingBars,
ipc_send,
localDateFormat,
setsList,
shell
@@ -106,6 +107,7 @@ function openEconomyTab(loadMore) {
let change = economyHistory[economyId];

if (change == undefined) continue;
if (change.archived && change.archived == true) continue;

// print out daily summaries but no sub-events
if (
@@ -618,6 +620,28 @@ function createChangeRow(change, economyId) {
changeRow.appendChild(flexLeft);
changeRow.appendChild(flexRight);

var deleteButton = document.createElement("div");
deleteButton.classList.add("flex_item");
deleteButton.classList.add(economyId + "_del");
deleteButton.classList.add("delete_item");

changeRow.appendChild(deleteButton);

deleteButton.addEventListener("mouseenter", () => {
deleteButton.style.width = "32px";
});

deleteButton.addEventListener("mouseleave", () => {
deleteButton.style.width = "4px";
});

deleteButton.addEventListener("click", e => {
e.stopPropagation();
ipc_send("archive_economy", economyId);
changeRow.style.height = "0px";
changeRow.style.overflow = "hidden";
});

return changeRow;
}

@@ -627,7 +627,7 @@ font-family: var(--main-font-name);
}

.list_economy_awarded {
margin: 0 24px;
margin: 0 8px 0 auto;
align-items: center;
overflow: -webkit-paged-x;
display: flex;

0 comments on commit 681effc

Please sign in to comment.
You can’t perform that action at this time.