(fast)
| 411 | } |
| 412 | |
| 413 | _positionEras(fast) { |
| 414 | |
| 415 | var era_color = 0; |
| 416 | // POSITION X |
| 417 | for (var i = 0; i < this._eras.length; i++) { |
| 418 | var pos = { |
| 419 | start: 0, |
| 420 | end: 0, |
| 421 | width: 0 |
| 422 | }; |
| 423 | |
| 424 | pos.start = this.timescale.getPosition(this._eras[i].start_date.getTime()); |
| 425 | pos.end = this.timescale.getPosition(this._eras[i].end_date.getTime()); |
| 426 | pos.width = pos.end - pos.start; |
| 427 | |
| 428 | if (fast) { |
| 429 | this._eras[i].setClass("tl-timeera tl-timeera-fast"); |
| 430 | } else { |
| 431 | this._eras[i].setClass("tl-timeera"); |
| 432 | } |
| 433 | this._eras[i].setPosition({ left: pos.start }); |
| 434 | this._eras[i].setWidth(pos.width); |
| 435 | |
| 436 | era_color++; |
| 437 | if (era_color > 5) { |
| 438 | era_color = 0; |
| 439 | } |
| 440 | this._eras[i].setColor(era_color); |
| 441 | }; |
| 442 | |
| 443 | } |
| 444 | |
| 445 | /* Public |
| 446 | ================================================== */ |
no test coverage detected