-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make a component out of the related-resources-manager, re #4771
- Loading branch information
Showing
5 changed files
with
380 additions
and
345 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
arches/app/media/js/views/components/search/related-resources-filter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
define(['knockout', | ||
'views/resource/related-resources-manager' | ||
], function(ko, RelatedResourcesManager) { | ||
return ko.components.register('related-resources-filter', { | ||
viewModel: function(options) { | ||
this.ready = ko.observable(false); | ||
this.options = options; | ||
// this component is just a light weight wrapper around the relatd resources manager | ||
// need to wait for the search-resutls filter to be ready | ||
// before we can load the realated-resources-filter | ||
// because we need to pass the entire rsearch results filter into the | ||
// related resources filter | ||
var loaded = ko.computed(function(){ | ||
return options.filters['search-results'](); | ||
}, this); | ||
loaded.subscribe(function(loaded) { | ||
options.searchResultsVm = options.filters['search-results'](); | ||
options.filters['related-resources-filter'](this); | ||
this.ready(true); | ||
}, this); | ||
}, | ||
template: { require: 'text!templates/views/components/search/related-resources-filter.htm'} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.