-
Notifications
You must be signed in to change notification settings - Fork 15
Added the capability to make filters exclusive #40
Conversation
reinouts
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide feedback to my comments?
| } | ||
|
|
||
| //only one value is defined to filter? Then the other is always true | ||
| // if (this.falseitem ^ this.trueitem){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't leave commented code in...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| for (var i = 0; i < this.menuItems.length; i++) { | ||
| var item = this.menuItems[i]; | ||
|
|
||
| if (item.label == label) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit verbose?
item.set("checked", (item.label == label)) is more concise and would still be readable IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| "use strict"; | ||
|
|
||
| return declare("TreeView.widget.Filters.AbstractFilter", null, { | ||
| fm: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's an fm?
| dropDown : this.menu | ||
| }); | ||
|
|
||
| if (this.filteranycaption) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use curly braces in if-else blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| dojo.place(this.dropdown.domNode, this.fm.domNode); | ||
| }, | ||
|
|
||
| getSearchConstraints: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already extend AbstractFilter right? Shouldn't this function with default implementation be already there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
|
|
||
| }, | ||
|
|
||
| free: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the empty implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
| }, | ||
|
|
||
| getSearchConstraints : function() { | ||
| // var filters = (!this.filtersexclusive) ? this.filter.getFilters() : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete commented line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/TreeView/widget/ui/Filters.css
Outdated
|
|
||
|
|
||
| .gv_filter_dropdown_menu .dijitChecked::before { | ||
| content: √; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be configurable??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree. This can be changed in a theme if someone wants to use something else. Plus, adding a symbol to ::before is not quite stable in Javascript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this css file does not even affect current rendering of the widget, so maybe I should actually delete it entirely. The final styling should be defined in the theme.
No description provided.