Skip to content

Fixed workingFilters scope issue (which broke filtering based on results down-selected by searching).#18

Open
pflarr wants to merge 1 commit intodanny-sg:masterfrom
pflarr:master
Open

Fixed workingFilters scope issue (which broke filtering based on results down-selected by searching).#18
pflarr wants to merge 1 commit intodanny-sg:masterfrom
pflarr:master

Conversation

@pflarr
Copy link
Copy Markdown

@pflarr pflarr commented Jun 8, 2017

workingFilters was defined in the scope of 'showFilter', but used outside that scope. It mostly worked, except when searching and then selecting filters. In that case, the workingFilters was set as an implicitly defined global, and the changes weren't picked up when 'OK' is clicked.

  • Moved the definition of workingFilters to the HeaderFilter() scope, which contains all the functions that use it.
  • Renamed workingFilters in the changeWorkingFilter function to baseWorkingFilter, to make it clear that we're working with a locally passed argument instead of the higher scoped workingFilters.

workingFilters was defined in the scope of 'showFilter', but used outside that scope. It mostly worked, except when searching and then selecting filters. In that case, the workingFilters was set as an implicitly defined global, and the changes weren't picked up when 'OK' is clicked. 
 - Moved the definition of workingFilters to the HeaderFilter() scope, which contains all the functions that use it.
 - Renamed workingFilters in the changeWorkingFilter function to baseWorkingFilter, to make it clear that we're working with a locally passed argument instead of the higher scoped workingFilters.
@akundzich
Copy link
Copy Markdown

This update must be taken as a final master version of the plugin.
I just spent some time fixing the same issue with workingFilters and it could be avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants