-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
259 changed files
with
7,960 additions
and
7,595 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,42 +1,22 @@ | ||
import { get, computed } from "@ember/object"; | ||
import attr from "ember-data/attr"; | ||
import Model from "ember-data/model"; | ||
|
||
|
||
const { hasOwnProperty } = {}; | ||
|
||
|
||
export default Model.extend({ | ||
query : attr( "string" ), | ||
// noinspection JSValidateTypes | ||
export default Model.extend( /** @class Search */ { | ||
/** @type {string} */ | ||
query: attr( "string" ), | ||
/** @type {string} */ | ||
filter: attr( "string" ), | ||
date : attr( "date" ), | ||
|
||
label: computed( "filter", function() { | ||
const filter = get( this, "filter" ); | ||
return this.constructor.getLabel( filter ); | ||
}) | ||
/** @type {Date} */ | ||
date: attr( "date" ) | ||
|
||
}).reopenClass({ | ||
toString() { return "Search"; }, | ||
|
||
filters: [ | ||
{ label: "All", id: "all" }, | ||
{ label: "Game", id: "games" }, | ||
{ label: "Channel", id: "channels" }, | ||
{ label: "Stream", id: "streams" } | ||
], | ||
|
||
filtersmap: computed(function() { | ||
return this.filters.reduce( ( map, filter ) => { | ||
map[ filter.id ] = filter; | ||
return map; | ||
}, {} ); | ||
}), | ||
|
||
getLabel( filter ) { | ||
const map = get( this, "filtersmap" ); | ||
return hasOwnProperty.call( map, filter ) | ||
? map[ filter ].label | ||
: "All"; | ||
} | ||
{ id: "all" }, | ||
{ id: "games" }, | ||
{ id: "channels" } | ||
] | ||
}); |
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.