cinera: Handle sorting state separately from UI
Also add user-select: none
This commit is contained in:
parent
d7d27f59b7
commit
3d7add5b66
|
@ -14,7 +14,7 @@ typedef struct
|
|||
version CINERA_APP_VERSION = {
|
||||
.Major = 0,
|
||||
.Minor = 5,
|
||||
.Patch = 28
|
||||
.Patch = 29
|
||||
};
|
||||
|
||||
// TODO(matt): Copy in the DB 3 stuff from cinera_working.c
|
||||
|
@ -4388,7 +4388,7 @@ IndexToBuffer(buffers *CollationBuffers) // NOTE(matt): This guy malloc's Collat
|
|||
" <div id=\"cineraResults\"></div>\n"
|
||||
"\n"
|
||||
" <div id=\"cineraIndex\" class=\"%s\">\n"
|
||||
" <div id=\"cineraIndexSort\" data-id=\"chronal\">Sort: Old to New ⏶</div>\n"
|
||||
" <div id=\"cineraIndexSort\">Sort: Old to New ⏶</div>\n"
|
||||
" <div id=\"cineraIndexEntries\">\n",
|
||||
StringsDiffer(Config.Theme, "") ? Config.Theme : Config.ProjectID,
|
||||
StringsDiffer(Config.Theme, "") ? Config.Theme : Config.ProjectID);
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
display: inline-block;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
#cineraIndex #cineraIndexEntries {
|
||||
|
|
|
@ -9,22 +9,21 @@ if (location.hash && location.hash.length > 0) {
|
|||
var indexContainer = document.getElementById("cineraIndex");
|
||||
var indexSort = indexContainer.querySelector("#cineraIndexSort");
|
||||
var indexEntries = indexContainer.querySelector("#cineraIndexEntries");
|
||||
var indexSortChronological = true;
|
||||
|
||||
indexSort.addEventListener("click", function(ev) {
|
||||
switch(this.getAttribute("data-id"))
|
||||
if(indexSortChronological)
|
||||
{
|
||||
case "chronal":
|
||||
this.setAttribute("data-id", "reverse_chronal");
|
||||
this.firstChild.nodeValue = "Sort: New to Old ⏷"
|
||||
indexEntries.classList.add("sort_reverse");
|
||||
break;
|
||||
case "reverse_chronal":
|
||||
this.setAttribute("data-id", "chronal");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.firstChild.nodeValue = "Sort: Old to New ⏶"
|
||||
indexEntries.classList.remove("sort_reverse");
|
||||
break;
|
||||
}
|
||||
})
|
||||
indexSortChronological = !indexSortChronological;
|
||||
});
|
||||
|
||||
var lastQuery = null;
|
||||
var resultsToRender = [];
|
||||
|
|
Loading…
Reference in New Issue