()
| 589 | } |
| 590 | |
| 591 | onClickChangeHeroButton () { |
| 592 | if (window.tracker != null) { |
| 593 | window.tracker.trackEvent('Students Change Hero Started', { category: 'Students' }) |
| 594 | } |
| 595 | let hasOnlyJuniorCourses = true |
| 596 | for (const courseInstance of this.courseInstances.models) { |
| 597 | if (courseInstance.get('courseID') !== utils.courseIDs.JUNIOR) { |
| 598 | hasOnlyJuniorCourses = false |
| 599 | break |
| 600 | } |
| 601 | } |
| 602 | const modal = new HeroSelectModal({ currentHeroID: this.hero.id, product: hasOnlyJuniorCourses ? 'codecombat-junior' : null }) |
| 603 | this.openModalView(modal) |
| 604 | this.listenTo(modal, 'hero-select:success', newHero => { |
| 605 | // @hero.url = "/db/thang.type/#{me.get('heroConfig').thangType}/version" |
| 606 | // @hero.fetch() |
| 607 | return this.hero.set(newHero.attributes) |
| 608 | }) |
| 609 | return this.listenTo(modal, 'hide', function () { |
| 610 | return this.stopListening(modal) |
| 611 | }) |
| 612 | } |
| 613 | |
| 614 | onSubmitJoinClassForm (e) { |
| 615 | e.preventDefault() |
nothing calls this directly
no test coverage detected