Skip to content

Commit

Permalink
Adding effects for immediately after click. Addresses #788
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsielicki committed Nov 9, 2017
1 parent c303e38 commit a904ced
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
11 changes: 10 additions & 1 deletion web-server/plugins/slycat-parameter-image/css/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,12 @@ rights in this software.
text-overflow: ellipsis;
overflow: hidden;
}
.slycat-category-filter .category-button.fresh:hover
{
border-color: #cfcfcf;
background-color: #e7e7e7;
color: #8f8f8f;
}
.auto-width .slycat-category-filter .category-button {
padding-right: 30px;
overflow: visible;
Expand All @@ -788,7 +794,9 @@ rights in this software.
border-bottom-width: 1px;
border-radius: 0 0 3px 3px;
}
.slycat-category-filter .category-button.active {
.slycat-category-filter .category-button.active,
.slycat-category-filter .category-button.active.fresh:hover
{
background-color: #abf;
border-color: #97A3FE;
color: #333;
Expand All @@ -804,6 +812,7 @@ rights in this software.
.slycat-category-filter .category-button.active:hover {
background-color: #cccccc;
border-color: #cccccc;
color: #8f8f8f;
}
.slycat-category-select {
/*max-width: 70px;*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ require(["slycat-server-root", "knockout", "knockout-mapping", "lodash"], functi
};

this.toggle = function(category) {
category.fresh(true);
if(category.selected())
{
category.selected(false);
Expand All @@ -32,6 +33,10 @@ require(["slycat-server-root", "knockout", "knockout-mapping", "lodash"], functi
}
};

this.mouseOut = function(category) {
category.fresh(false);
}

self.style = ko.pureComputed(function()
{
var result = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ define("slycat-parameter-image-filter-manager", ["slycat-server-root", "slycat-d
type: "GET",
url : server_root + "models/" + vm.model_id() + "/arraysets/data-table/metadata?unique=0/" + targetFilter.index() + "/...",
success : function(result) {
_(result.unique[0].values[0]).sort().each(function(c) { targetFilter.categories.push({value: ko.observable(c), selected: ko.observable(true)}); }).value(); // selected by default
_(result.unique[0].values[0]).sort().each(function(c) { targetFilter.categories.push({value: ko.observable(c), selected: ko.observable(true), fresh: ko.observable(false)}); }).value(); // selected by default
// Bookmark once all unique values are set
self.bookmarker.updateState( {"allFilters" : mapping.toJS(vm.allFilters())} );
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="slycat-category-filter" data-bind="style:style">
<div data-bind="foreach: categories" class="slycat-category-select" role="group" style="position: relative">
<div class="category-button" data-bind="text: value, css: { active: selected }, click: $parent.toggle">
<div class="category-button" data-bind="text: value, css: { active: selected, fresh: fresh }, click: $parent.toggle, event: { mouseout: $parent.mouseOut }">
</div>
</div>
</div>

0 comments on commit a904ced

Please sign in to comment.