2018-03-03 23:15:50 +01:00
|
|
|
export function timelineMixins (Store) {
|
2018-01-28 22:09:39 +01:00
|
|
|
Store.prototype.setForTimeline = function (instanceName, timelineName, obj) {
|
|
|
|
let timelines = this.get('timelines') || {}
|
|
|
|
let timelineData = timelines[instanceName] || {}
|
|
|
|
timelineData[timelineName] = Object.assign(timelineData[timelineName] || {}, obj)
|
|
|
|
timelines[instanceName] = timelineData
|
|
|
|
this.set({timelines: timelines})
|
|
|
|
}
|
|
|
|
|
|
|
|
Store.prototype.getForTimeline = function (instanceName, timelineName, key) {
|
|
|
|
let timelines = this.get('timelines') || {}
|
|
|
|
let timelineData = timelines[instanceName] || {}
|
|
|
|
return (timelineData[timelineName] || {})[key]
|
|
|
|
}
|
2018-02-10 22:57:04 +01:00
|
|
|
|
|
|
|
Store.prototype.setForCurrentTimeline = function (obj) {
|
|
|
|
let instanceName = this.get('currentInstance')
|
|
|
|
let timelineName = this.get('currentTimeline')
|
|
|
|
this.setForTimeline(instanceName, timelineName, obj)
|
|
|
|
}
|
2018-01-28 22:09:39 +01:00
|
|
|
}
|