Skip to content

Instantly share code, notes, and snippets.

@davidjgonzalez
Created September 20, 2018 21:00
Show Gist options
  • Save davidjgonzalez/6163dd08c3486c624a49726f4f8a873d to your computer and use it in GitHub Desktop.
Save davidjgonzalez/6163dd08c3486c624a49726f4f8a873d to your computer and use it in GitHub Desktop.
import Bem from '../../../../util/Bem';
export default class Sort {
constructor() {
this.bem = new Bem('cmp-search-sort');
this.component = $(this.bem.selector());
this.sortByElement = this.component.element(this.bem.scope('selection', 'sort-by').selector());
this.sortDirectionElement = this.component.element(this.bem.scope('selection', 'sort-direction').selector());
}
get sortByLabel() {
return this.sortByElement.element(this.bem.element('selection-text'));
}
get sortByOptions() {
return this.sortByElement.elements(this.bem.element('selection-item'))
}
get sortDirectionLabel() {
return this.sortDirectionElement.element(this.bem.element('selection-text'));
}
get sortDirectionOptions() {
return this.sortDirectionElement.elements(this.bem.element('selection-item'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment