mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:12:45 +08:00
DEV: drops jquery usage from wizard-canvas (#14662)
This commit is contained in:
parent
adb302f801
commit
c2d4638ee1
|
@ -1,3 +1,4 @@
|
|||
import { bind } from "discourse-common/utils/decorators";
|
||||
import Component from "@ember/component";
|
||||
const MAX_PARTICLES = 150;
|
||||
|
||||
|
@ -75,17 +76,19 @@ export default Component.extend({
|
|||
this.ready = true;
|
||||
this.paint();
|
||||
|
||||
$(window).on("resize.wizard", () => this.resized());
|
||||
window.addEventListener("resize", this.resized);
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
$(window).off("resize.wizard");
|
||||
|
||||
window.removeEventListener("resize", this.resized);
|
||||
},
|
||||
|
||||
@bind
|
||||
resized() {
|
||||
width = $(window).width();
|
||||
height = $(window).height();
|
||||
width = window.innerWidth;
|
||||
height = window.innerHeight;
|
||||
|
||||
const canvas = this.element;
|
||||
canvas.width = width;
|
||||
|
|
Loading…
Reference in New Issue
Block a user