| 227 | } |
| 228 | |
| 229 | setZoomFactor(factor) { |
| 230 | if (factor <= this.options.zoom_sequence[0]) { |
| 231 | this.fire("zoomtoggle", { zoom: "out", show: false }); |
| 232 | } else { |
| 233 | this.fire("zoomtoggle", { zoom: "out", show: true }); |
| 234 | } |
| 235 | |
| 236 | if (factor >= this.options.zoom_sequence[this.options.zoom_sequence.length - 1]) { |
| 237 | this.fire("zoomtoggle", { zoom: "in", show: false }); |
| 238 | } else { |
| 239 | this.fire("zoomtoggle", { zoom: "in", show: true }); |
| 240 | } |
| 241 | |
| 242 | if (factor == 0) { |
| 243 | console.warn("Zoom factor must be greater than zero. Using 0.1"); |
| 244 | factor = 0.1; |
| 245 | } |
| 246 | this.options.scale_factor = factor; |
| 247 | //this._updateDrawTimeline(true); |
| 248 | this.goToId(this.current_id, !this._updateDrawTimeline(true), true); |
| 249 | } |
| 250 | |
| 251 | /* Groups |
| 252 | ================================================== */ |