| 147 | } |
| 148 | |
| 149 | savePoll (e) { |
| 150 | this.treema.endExistingEdits() |
| 151 | for (const key in this.treema.data) { |
| 152 | const value = this.treema.data[key] |
| 153 | this.poll.set(key, value) |
| 154 | } |
| 155 | |
| 156 | return this.validateNextPollIds(this.poll.get('answers')).then(() => { |
| 157 | const res = this.poll.save() |
| 158 | |
| 159 | res.error((collection, response, options) => { |
| 160 | return console.error(response) |
| 161 | }) |
| 162 | |
| 163 | return res.success(() => { |
| 164 | const url = `/editor/poll/${this.poll.get('slug') || this.poll.id}` |
| 165 | return document.location.href = url |
| 166 | }) |
| 167 | }) |
| 168 | } |
| 169 | |
| 170 | confirmDeletion () { |
| 171 | const renderData = { |