2018-02-10 13:57:04 -08:00
|
|
|
|
2018-02-11 09:37:13 -08:00
|
|
|
function computeForTimeline (store, key) {
|
2018-02-10 13:57:04 -08:00
|
|
|
store.compute(key, ['currentTimelineData'], (currentTimelineData) => currentTimelineData[key])
|
|
|
|
}
|
|
|
|
|
2018-02-08 22:29:29 -08:00
|
|
|
export function timelineComputations (store) {
|
2018-01-28 13:09:39 -08:00
|
|
|
store.compute('currentTimelineData', ['currentInstance', 'currentTimeline', 'timelines'],
|
|
|
|
(currentInstance, currentTimeline, timelines) => {
|
|
|
|
return ((timelines && timelines[currentInstance]) || {})[currentTimeline] || {}
|
|
|
|
})
|
|
|
|
|
2018-02-10 13:57:04 -08:00
|
|
|
computeForTimeline(store, 'timelineItemIds')
|
|
|
|
computeForTimeline(store, 'runningUpdate')
|
|
|
|
computeForTimeline(store, 'initialized')
|
|
|
|
computeForTimeline(store, 'lastFocusedElementSelector')
|
|
|
|
computeForTimeline(store, 'ignoreBlurEvents')
|
2018-02-11 13:46:57 -08:00
|
|
|
computeForTimeline(store, 'itemIdsToAdd')
|
2018-02-11 19:15:21 -08:00
|
|
|
computeForTimeline(store, 'showHeader')
|
|
|
|
computeForTimeline(store, 'shouldShowHeader')
|
2018-02-10 13:57:04 -08:00
|
|
|
|
2018-02-10 14:19:10 -08:00
|
|
|
store.compute('firstTimelineItemId', ['timelineItemIds'], (timelineItemIds) => timelineItemIds && timelineItemIds.length && timelineItemIds[0])
|
2018-02-08 18:54:48 -08:00
|
|
|
store.compute('lastTimelineItemId', ['timelineItemIds'], (timelineItemIds) => timelineItemIds && timelineItemIds.length && timelineItemIds[timelineItemIds.length - 1])
|
2018-02-08 22:29:29 -08:00
|
|
|
}
|