Skip to content

Commit

Permalink
no createEvent (#28305)
Browse files Browse the repository at this point in the history
  • Loading branch information
ycw committed May 7, 2024
1 parent c78c003 commit 58c13e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions editor/js/libs/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,7 @@ class UINumber extends UIElement {

const scope = this;

const changeEvent = document.createEvent( 'HTMLEvents' );
changeEvent.initEvent( 'change', true, true );
const changeEvent = new Event( 'change', { bubbles: true, cancelable: true } );

let distance = 0;
let onMouseDownValue = 0;
Expand Down Expand Up @@ -814,8 +813,7 @@ class UIInteger extends UIElement {

const scope = this;

const changeEvent = document.createEvent( 'HTMLEvents' );
changeEvent.initEvent( 'change', true, true );
const changeEvent = new Event( 'change', { bubbles: true, cancelable: true } );

let distance = 0;
let onMouseDownValue = 0;
Expand Down Expand Up @@ -1268,8 +1266,7 @@ class UIListbox extends UIDiv {

this.selectedValue = value;

const changeEvent = document.createEvent( 'HTMLEvents' );
changeEvent.initEvent( 'change', true, true );
const changeEvent = new Event( 'change', { bubbles: true, cancelable: true } );
this.dom.dispatchEvent( changeEvent );

}
Expand Down
9 changes: 3 additions & 6 deletions editor/js/libs/ui.three.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ class UIOutliner extends UIDiv {

this.setValue( this.options[ index ].value );

const changeEvent = document.createEvent( 'HTMLEvents' );
changeEvent.initEvent( 'change', true, true );
const changeEvent = new Event( 'change', { bubbles: true, cancelable: true } );
this.dom.dispatchEvent( changeEvent );

}
Expand All @@ -335,8 +334,7 @@ class UIOutliner extends UIDiv {

scope.setValue( this.value );

const changeEvent = document.createEvent( 'HTMLEvents' );
changeEvent.initEvent( 'change', true, true );
const changeEvent = new Event( 'change', { bubbles: true, cancelable: true } );
scope.dom.dispatchEvent( changeEvent );

}
Expand Down Expand Up @@ -449,8 +447,7 @@ class UIOutliner extends UIDiv {
const editor = scope.editor;
editor.execute( new MoveObjectCommand( editor, object, newParent, nextObject ) );

const changeEvent = document.createEvent( 'HTMLEvents' );
changeEvent.initEvent( 'change', true, true );
const changeEvent = new Event( 'change', { bubbles: true, cancelable: true } );
scope.dom.dispatchEvent( changeEvent );

}
Expand Down

0 comments on commit 58c13e6

Please sign in to comment.