* @param {!JsonObject} action
(action)
| 27 | * @param {!JsonObject} action |
| 28 | */ |
| 29 | update(action) { |
| 30 | let changed = false; |
| 31 | |
| 32 | switch (action['_scramp']) { |
| 33 | case 'au': |
| 34 | changed = this.updateHorizontalLayout(action); |
| 35 | ['open', 'url', 'title'].forEach((key) => { |
| 36 | if (hasOwn(action, key) && action[key] !== this.state_[key]) { |
| 37 | this.state_[key] = action[key]; |
| 38 | changed = true; |
| 39 | } |
| 40 | }); |
| 41 | break; |
| 42 | case 'st': |
| 43 | ['revealed'].forEach((key) => { |
| 44 | if (hasOwn(action, key) && action[key] !== this.state_[key]) { |
| 45 | this.state_[key] = action[key]; |
| 46 | changed = true; |
| 47 | } |
| 48 | }); |
| 49 | break; |
| 50 | } |
| 51 | |
| 52 | if (changed) { |
| 53 | this.render_(this.state_); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * @param {!Sheet.State} state |
no test coverage detected