File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
tools/post-process-editor Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ export default class EditorAssets {
137
137
138
138
// Empty or not
139
139
if ( assets . length === 0 ) {
140
- this . emptyTextNode = Tools . CreateElement < HTMLHeadElement > ( 'h1' , BabylonTools . RandomId ( ) , {
140
+ const emptyTextNode = Tools . CreateElement < HTMLHeadElement > ( 'h1' , BabylonTools . RandomId ( ) , {
141
141
'float' : 'left' ,
142
142
'left' : '50%' ,
143
143
'top' : '50%' ,
@@ -147,9 +147,9 @@ export default class EditorAssets {
147
147
'font-family' : 'Roboto,sans-serif !important' ,
148
148
'opacity' : '0.5'
149
149
} ) ;
150
- this . emptyTextNode . textContent = 'Empty' ;
150
+ emptyTextNode . textContent = 'Empty' ;
151
151
152
- $ ( '#' + c . id ) . append ( this . emptyTextNode ) ;
152
+ $ ( '#' + c . id ) . append ( emptyTextNode ) ;
153
153
}
154
154
155
155
// Add elements
@@ -250,8 +250,9 @@ export default class EditorAssets {
250
250
else
251
251
$ ( '#' + component . id ) . hide ( ) ;
252
252
253
- // Save component
253
+ // Save component and refresh
254
254
this . components . push ( component ) ;
255
+ this . refresh ( component . id ) ;
255
256
}
256
257
257
258
/**
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export default class Dialog {
37
37
* @param title the title of the dialog
38
38
*/
39
39
public static CreateWithTextInput ( title : string ) : Promise < string > {
40
- return new Promise < string > ( ( resolve ) => {
40
+ return new Promise < string > ( ( resolve , reject ) => {
41
41
// Window
42
42
const popin = new Window ( 'AskName' ) ;
43
43
popin . title = title ;
@@ -56,7 +56,10 @@ export default class Dialog {
56
56
form . build ( 'ASK-NAME-CREATE-DIALOG' ) ;
57
57
58
58
// Events
59
- popin . onClose = ( ) => form . element . destroy ( ) ;
59
+ popin . onClose = ( ) => {
60
+ form . element . destroy ( ) ;
61
+ reject ( 'User decided to not give an input' ) ;
62
+ } ;
60
63
61
64
popin . onButtonClick = id => {
62
65
if ( ! form . isValid ( ) )
Original file line number Diff line number Diff line change @@ -218,17 +218,17 @@ export default class PostProcessEditor extends EditorPlugin {
218
218
* @param id the id of the selected item
219
219
*/
220
220
protected deletePostProcess ( id : number ) : void {
221
- const data = this . datas [ id ] ;
222
-
223
- const p = this . createOrUpdatePostProcess ( data . name ) ;
224
- p . dispose ( ) ;
221
+ const p = this . createOrUpdatePostProcess ( this . datas [ id ] . name ) ;
222
+ if ( p )
223
+ p . dispose ( ) ;
225
224
226
225
// Remove data
227
226
this . datas . splice ( id , 1 ) ;
228
227
this . data = this . datas [ 0 ] ;
229
228
230
- // Check if empty
231
- if ( this . datas . length === 0 ) {
229
+ if ( this . data )
230
+ this . selectPostProcess ( 0 ) ;
231
+ else {
232
232
this . code . setValue ( '' ) ;
233
233
this . pixel . setValue ( '' ) ;
234
234
this . config . setValue ( '' ) ;
@@ -297,7 +297,6 @@ export default class PostProcessEditor extends EditorPlugin {
297
297
298
298
if ( p . name === name ) {
299
299
p . setConfig ( JSON . parse ( this . data . config ) ) ;
300
- p . userConfig = { } ;
301
300
this . editor . core . onSelectObject . notifyObservers ( p ) ;
302
301
return p ;
303
302
}
You can’t perform that action at this time.
0 commit comments