| 80 | } |
| 81 | |
| 82 | function SequenceModel(seq, prop, store) { |
| 83 | this.head = [] |
| 84 | this.body = [] |
| 85 | this.foot = [] |
| 86 | |
| 87 | each(seq.members, (id, index) => { |
| 88 | const element = store.elements[id] |
| 89 | if (element && element[prop]) { |
| 90 | this.body.push(index) |
| 91 | } |
| 92 | }) |
| 93 | |
| 94 | if (this.body.length) { |
| 95 | each(seq.members, (id, index) => { |
| 96 | const element = store.elements[id] |
| 97 | if (element && !element[prop]) { |
| 98 | if (index < this.body[0]) { |
| 99 | this.head.push(index) |
| 100 | } else { |
| 101 | this.foot.push(index) |
| 102 | } |
| 103 | } |
| 104 | }) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | function cue(seq, i, direction, pristine) { |
| 109 | const blocked = ['head', null, 'foot'][1 + direction] |