Skip to content

Commit

Permalink
Simplifying how post click effect is applies and making it work with …
Browse files Browse the repository at this point in the history
…existing bookmarks. Closes #788
  • Loading branch information
alexsielicki committed Nov 9, 2017
1 parent a904ced commit 5680c67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ require(["slycat-server-root", "knockout", "knockout-mapping", "lodash"], functi
});
};

this.toggle = function(category) {
category.fresh(true);
this.toggle = function(category, event) {
event.target.classList.add('fresh');
if(category.selected())
{
category.selected(false);
Expand All @@ -33,8 +33,8 @@ require(["slycat-server-root", "knockout", "knockout-mapping", "lodash"], functi
}
};

this.mouseOut = function(category) {
category.fresh(false);
this.mouseOut = function(category, event) {
event.target.classList.remove('fresh');;
}

self.style = ko.pureComputed(function()
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), fresh: ko.observable(false)}); }).value(); // selected by default
_(result.unique[0].values[0]).sort().each(function(c) { targetFilter.categories.push({value: ko.observable(c), selected: ko.observable(true)}); }).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, fresh: fresh }, click: $parent.toggle, event: { mouseout: $parent.mouseOut }">
<div class="category-button" data-bind="text: value, css: { active: selected }, click: $parent.toggle, event: { mouseout: $parent.mouseOut }">
</div>
</div>
</div>

0 comments on commit 5680c67

Please sign in to comment.