Skip to content
Permalink
Browse files

Merge pull request #279 from ptasznikarium/feature/collection-filter-…

…playsets

add 'Incomplete only' filter in Collection
  • Loading branch information...
Manuel-777 committed Apr 23, 2019
2 parents 07f2234 + c8a9dd3 commit 3b21378aa799f52b5717afb42879f1d3928cee91
Showing with 33 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +15 −0 window_main/collection.js
  3. +17 −0 window_main/index.css
@@ -7,3 +7,4 @@ main.sublime-project
*.sublime-settings
.vscode
.DS_Store
/.vs
@@ -229,6 +229,12 @@ function openCollectionTab() {
"query_unown",
false
);
addCheckboxSearch(
cont,
'<div class="icon_search_incomplete_left"></div><div class="icon_search_incomplete_right"></div>Incomplete only',
"query_incomplete",
false
);
addCheckboxSearch(
cont,
'<div class="icon_search_new"></div>Newly acquired only',
@@ -395,6 +401,7 @@ function resetFilters() {
document.getElementById("query_name").value = "";
document.getElementById("query_type").value = "";
document.getElementById("query_unown").checked = false;
document.getElementById("query_incomplete").checked = false;
document.getElementById("query_new").checked = false;
document.getElementById("query_multicolor").checked = false;
document.getElementById("query_exclude").checked = false;
@@ -642,6 +649,7 @@ function printCards() {
let filterName = document.getElementById("query_name").value.toLowerCase();
let filterType = document.getElementById("query_type").value.toLowerCase();
let filterUnown = document.getElementById("query_unown").checked;
let filterIncomplete = document.getElementById("query_incomplete").checked;
let filterNew = document.getElementById("query_new");
let filterMulti = document.getElementById("query_multicolor");
let filterExclude = document.getElementById("query_exclude");
@@ -713,6 +721,13 @@ function printCards() {
}
});

if (filterIncomplete) {
let owned = cards[card.id];
if (owned >= 4) {
continue;
}
}

if (filterNew.checked && cardsNew[key] == undefined) {
doDraw = false;
}
@@ -1231,6 +1231,23 @@ a:hover {
background: center no-repeat url('../images/quantity_gray.png');
}

.icon_search_incomplete_left {
display: -webkit-inline-box;
width: 10px;
height: 20px;
background: left no-repeat url('../images/quantity_green.png');
background-size: cover;
}

.icon_search_incomplete_right {
display: -webkit-inline-box;
width: 10px;
margin-right: 16px;
height: 20px;
background: right no-repeat url('../images/quantity_gray.png');
background-size: cover;
}

.icon_search_new {
display: -webkit-inline-box;
width: 20px;

0 comments on commit 3b21378

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