Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Tidy up, no createEvent #28305

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -812,8 +811,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 @@ -1266,8 +1264,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
Loading