uil 4.0.0 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +5 -1
  2. package/build/uil.js +33 -45
  3. package/build/uil.min.js +1 -1
  4. package/build/uil.module.js +45 -58
  5. package/package.json +6 -10
  6. package/examples/js/BufferGeometryUtils.js +0 -921
  7. package/examples/js/SimplexNoise.js +0 -324
  8. package/examples/js/controls/OrbitControls.js +0 -1215
  9. package/examples/js/controls/OrbitControls_.js +0 -1042
  10. package/examples/js/libs/sea3d.min.js +0 -373
  11. package/examples/js/libs/three.min.js +0 -6
  12. package/examples/js/math.js +0 -447
  13. package/examples/js/objects/Landscape.js +0 -778
  14. package/examples/js/objects/Lensflare.js +0 -372
  15. package/examples/js/objects/SuperSky.js +0 -297
  16. package/examples/js/objects/Water.js +0 -329
  17. package/src/Uil.js +0 -6
  18. package/src/Uil_dev.js +0 -15
  19. package/src/core/Gui.js +0 -807
  20. package/src/core/Proto.js +0 -679
  21. package/src/core/Roots.js +0 -864
  22. package/src/core/Tools.js +0 -830
  23. package/src/core/V2.js +0 -131
  24. package/src/core/add.js +0 -85
  25. package/src/polyfills.js +0 -85
  26. package/src/proto/Bool.js +0 -147
  27. package/src/proto/Button.js +0 -357
  28. package/src/proto/Circular.js +0 -230
  29. package/src/proto/Color.js +0 -411
  30. package/src/proto/Empty.js +0 -15
  31. package/src/proto/Fps.js +0 -327
  32. package/src/proto/Graph.js +0 -310
  33. package/src/proto/Grid.js +0 -297
  34. package/src/proto/Group.js +0 -430
  35. package/src/proto/Item.js +0 -120
  36. package/src/proto/Joystick.js +0 -241
  37. package/src/proto/Knob.js +0 -262
  38. package/src/proto/List.js +0 -789
  39. package/src/proto/Numeric.js +0 -417
  40. package/src/proto/Pad2D.js +0 -268
  41. package/src/proto/Rubric.js +0 -0
  42. package/src/proto/Select.js +0 -178
  43. package/src/proto/Selector.js +0 -13
  44. package/src/proto/Slide.js +0 -267
  45. package/src/proto/TextInput.js +0 -181
  46. package/src/proto/Title.js +0 -61
package/src/proto/List.js DELETED
@@ -1,789 +0,0 @@
1
- import { Proto } from '../core/Proto.js';
2
- import { Roots } from '../core/Roots.js';
3
-
4
- export class List extends Proto {
5
-
6
- constructor( o = {} ) {
7
-
8
- super( o );
9
-
10
- // images
11
- this.path = o.path || '';
12
- this.format = o.format || '';
13
-
14
-
15
- this.isWithImage = this.path !== '' ? true:false;
16
- this.preLoadComplete = false;
17
-
18
- this.tmpImage = {};
19
- this.tmpUrl = [];
20
-
21
- //this.autoHeight = false;
22
-
23
- let align = o.align || 'center';
24
-
25
- // scroll size
26
- let ss = o.scrollSize || 10
27
- this.ss = ss+1
28
-
29
- this.sMode = 0;
30
- this.tMode = 0;
31
-
32
- this.listOnly = o.listOnly || false;
33
- this.staticTop = o.staticTop || false;
34
-
35
- this.isSelectable = this.listOnly;
36
- if( o.select !== undefined ) o.selectable = o.select
37
- if( o.selectable !== undefined ) this.isSelectable = o.selectable
38
-
39
- if( this.txt === '' ) this.p = 0;
40
-
41
-
42
- let fltop = Math.floor(this.h*0.5)-5;
43
- let cc = this.colors
44
-
45
-
46
-
47
- this.c[2] = this.dom( 'div', this.css.basic + 'top:0; display:none; border-radius:'+this.radius+'px;' );
48
- this.c[3] = this.dom( 'div', this.css.item + 'position:absolute; text-align:'+align+'; line-height:'+(this.h-4)+'px; top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:1px solid '+cc.border+'; border-radius:'+this.radius+'px;' );
49
- this.c[4] = this.dom( 'path', this.css.basic + 'position:absolute; width:10px; height:10px; top:'+fltop+'px;', { d:this.svgs.arrow, fill:cc.text, stroke:'none'});
50
-
51
- this.scrollerBack = this.dom( 'div', this.css.basic + 'right:0px; width:'+ss+'px; background:'+cc.back+'; display:none;');
52
- this.scroller = this.dom( 'div', this.css.basic + 'right:'+((ss-(ss*0.25))*0.5)+'px; width:'+(ss*0.25)+'px; background:'+cc.text+'; display:none; ');
53
-
54
- this.c[3].style.color = cc.text;
55
-
56
-
57
- this.list = []
58
- this.refObject = null
59
-
60
- if(o.list){
61
- if( o.list instanceof Array ){
62
- this.list = o.list
63
- } else {
64
- this.refObject = o.list
65
- for( let g in this.refObject ) this.list.push(g)
66
- }
67
- }
68
-
69
- this.items = [];
70
-
71
- this.prevName = '';
72
-
73
- this.baseH = this.h;
74
-
75
- this.itemHeight = o.itemHeight || (this.h-3);
76
-
77
- // force full list
78
- this.full = o.full || false;
79
-
80
- this.py = 0;
81
- this.ww = this.sb;
82
- this.scroll = false;
83
- this.isDown = false;
84
-
85
- this.current = null;
86
-
87
- // list up or down
88
- this.side = o.side || 'down';
89
- this.up = this.side === 'down' ? 0 : 1;
90
-
91
- if( this.up ){
92
-
93
- this.c[2].style.top = 'auto';
94
- this.c[3].style.top = 'auto';
95
- this.c[4].style.top = 'auto';
96
- //this.c[5].style.top = 'auto';
97
-
98
- this.c[2].style.bottom = this.h-2 + 'px';
99
- this.c[3].style.bottom = '1px';
100
- this.c[4].style.bottom = fltop + 'px';
101
-
102
- } else {
103
- this.c[2].style.top = this.baseH + 'px';
104
- }
105
-
106
- this.listIn = this.dom( 'div', this.css.basic + 'left:0; top:0; width:100%; background:none;');
107
- this.listIn.name = 'list';
108
-
109
-
110
-
111
- this.topList = 0;
112
-
113
- this.c[2].appendChild( this.listIn );
114
- this.c[2].appendChild( this.scrollerBack );
115
- this.c[2].appendChild( this.scroller );
116
-
117
- if( o.value !== undefined ){
118
- if(!isNaN(o.value)) this.value = this.list[ o.value ];
119
- else this.value = o.value;
120
- }else{
121
- this.value = this.list[0];
122
- }
123
-
124
- this.isOpenOnStart = o.open || false;
125
-
126
- if( this.listOnly ){
127
- this.baseH = 5;
128
- this.c[3].style.display = 'none';
129
- this.c[4].style.display = 'none';
130
- this.c[2].style.top = this.baseH+'px'
131
- this.isOpenOnStart = true;
132
- }
133
-
134
-
135
- this.miniCanvas = o.miniCanvas || false
136
- this.canvasBg = o.canvasBg || 'rgba(0,0,0,0)'
137
- this.imageSize = o.imageSize || [20,20];
138
-
139
- // dragout function
140
- this.drag = o.drag || false
141
- this.dragout = o.dragout || false
142
- this.dragstart = o.dragstart || null
143
- this.dragend = o.dragend || null
144
-
145
-
146
-
147
- //this.c[0].style.background = '#FF0000'
148
- if( this.isWithImage ) this.preloadImage();
149
- // } else {
150
- // populate list
151
- this.setList( this.list );
152
- this.init();
153
- if( this.isOpenOnStart ) this.open( true );
154
- // }
155
-
156
- }
157
-
158
- /*send ( v ) {
159
-
160
- super.send( v );
161
-
162
- //Proto.prototype.send.call( this, v );
163
- }*/
164
-
165
- // image list
166
-
167
- preloadImage () {
168
-
169
- this.preLoadComplete = false;
170
-
171
- this.tmpImage = {};
172
- for( let i=0; i<this.list.length; i++ ) this.tmpUrl.push( this.list[i] );
173
- this.loadOne();
174
-
175
- }
176
-
177
- nextImg () {
178
-
179
- this.tmpUrl.shift();
180
- if( this.tmpUrl.length === 0 ){
181
-
182
- this.preLoadComplete = true;
183
-
184
- this.addImages();
185
- /*this.setList( this.list );
186
- this.init();
187
- if( this.isOpenOnStart ) this.open();*/
188
-
189
- }
190
- else this.loadOne();
191
-
192
- }
193
-
194
- loadOne(){
195
-
196
- let self = this
197
- let name = this.tmpUrl[0];
198
- let img = document.createElement('img');
199
- img.style.cssText = 'position:absolute; width:'+self.imageSize[0]+'px; height:'+self.imageSize[1]+'px';
200
- img.setAttribute('src', this.path + name + this.format );
201
-
202
- img.addEventListener('load', function() {
203
-
204
- self.imageSize[2] = img.width;
205
- self.imageSize[3] = img.height;
206
- self.tmpImage[name] = img;
207
- self.nextImg();
208
-
209
- });
210
-
211
- }
212
-
213
- //
214
-
215
- testZone ( e ) {
216
-
217
- let l = this.local;
218
- if( l.x === -1 && l.y === -1 ) return '';
219
-
220
- if( this.up && this.isOpen ){
221
- if( l.y > this.h - this.baseH ) return 'title';
222
- else{
223
- if( this.scroll && ( l.x > (this.sa+this.sb-this.ss)) ) return 'scroll';
224
- if(l.x > this.sa) return this.testItems( l.y-this.baseH );
225
- }
226
-
227
- } else {
228
- if( l.y < this.baseH+2 ) return 'title';
229
- else{
230
- if( this.isOpen ){
231
- if( this.scroll && ( l.x > (this.sa+this.sb-this.ss)) ) return 'scroll';
232
- if(l.x > this.sa) return this.testItems( l.y-this.baseH );
233
- }
234
- }
235
-
236
- }
237
-
238
- return '';
239
-
240
- }
241
-
242
- testItems ( y ) {
243
-
244
- let name = '';
245
-
246
- let i = this.items.length, item, a, b;
247
- while(i--){
248
- item = this.items[i];
249
- a = item.posy + this.topList;
250
- b = item.posy + this.itemHeight + 1 + this.topList;
251
- if( y >= a && y <= b ){
252
- name = 'item' + i;
253
- this.modeItem(0)
254
- this.current = item;
255
- this.modeItem(1)
256
- return name;
257
- }
258
-
259
- }
260
-
261
- return name;
262
-
263
- }
264
-
265
- modeItem ( mode ) {
266
-
267
- if( !this.current ) return
268
-
269
- if( this.current.select && mode===0) mode = 2
270
- let cc = this.colors
271
-
272
- switch( mode ){
273
-
274
- case 0: // base
275
- this.current.style.background = cc.back
276
- this.current.style.color = cc.text;
277
- break;
278
- case 1: // over
279
- this.current.style.background = cc.over
280
- this.current.style.color = cc.textOver;
281
- break;
282
- case 2: // edit / down
283
- this.current.style.background = cc.select
284
- this.current.style.color = cc.textSelect;
285
- break;
286
-
287
- }
288
- }
289
-
290
- unSelected() {
291
-
292
- if( !this.current ) return
293
- this.modeItem(0)
294
- this.current = null
295
-
296
- }
297
-
298
- selected() {
299
-
300
- if( !this.current ) return
301
- this.resetItems()
302
- this.modeItem(2)
303
- this.current.select = true
304
-
305
- }
306
-
307
- resetItems() {
308
-
309
- let i = this.items.length
310
- while(i--){
311
- this.items[i].select = false
312
- this.items[i].style.background = this.colors.back;
313
- this.items[i].style.color = this.colors.text;
314
- }
315
-
316
- }
317
-
318
- // ----------------------
319
- // EVENTS
320
- // ----------------------
321
-
322
-
323
- mouseup ( e ) {
324
-
325
- this.isDown = false;
326
-
327
- }
328
-
329
- mousedown ( e ) {
330
-
331
- let name = this.testZone( e );
332
-
333
- if( !name ) return false;
334
-
335
- if( name === 'scroll' ){
336
-
337
- this.isDown = true;
338
- this.mousemove( e );
339
-
340
- } else if( name === 'title' ){
341
-
342
- this.modeTitle(2);
343
- if( !this.listOnly ){
344
- if( !this.isOpen ) this.open();
345
- else this.close();
346
- }
347
- } else {
348
- // is item
349
- if( this.current ){
350
-
351
- this.value = this.list[ this.current.id ]
352
-
353
- if( this.isSelectable ) this.selected()
354
- //this.value = this.refObject !== null ? this.refObject[this.list[this.current.id]] : this.list[this.current.id]
355
- //this.value = this.current.textContent;
356
- this.send( this.refObject !== null ? this.refObject[this.list[this.current.id]] : this.value );
357
-
358
- if( !this.listOnly ) {
359
- this.close();
360
- this.setTopItem();
361
- }
362
- }
363
-
364
- }
365
-
366
- return true;
367
-
368
- }
369
-
370
- mousemove ( e ) {
371
-
372
- let nup = false;
373
- let name = this.testZone( e );
374
-
375
- if( !name ) return nup;
376
-
377
- if( name === 'title' ){
378
- this.unSelected();
379
- this.modeTitle(1);
380
- this.cursor('pointer');
381
-
382
- } else if( name === 'scroll' ){
383
-
384
- this.cursor('s-resize');
385
- this.modeScroll(1);
386
- if( this.isDown ){
387
- this.modeScroll(2);
388
- let top = this.zone.y+this.baseH-2;
389
- this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
390
- }
391
- //if(this.isDown) this.listmove(e);
392
- } else {
393
-
394
- // is item
395
- this.modeTitle(0);
396
- this.modeScroll(0);
397
- this.cursor('pointer');
398
-
399
- }
400
-
401
- if( name !== this.prevName ) nup = true;
402
- this.prevName = name;
403
-
404
- return nup;
405
-
406
- }
407
-
408
- wheel ( e ) {
409
-
410
- let name = this.testZone( e );
411
- if( name === 'title' ) return false;
412
- this.py += e.delta*10;
413
- this.update(this.py);
414
- return true;
415
-
416
- }
417
-
418
-
419
-
420
- // ----------------------
421
-
422
- reset () {
423
-
424
- this.prevName = '';
425
- this.unSelected();
426
- this.modeTitle(0);
427
- this.modeScroll(0);
428
-
429
- //console.log('this is reset')
430
-
431
- }
432
-
433
- modeScroll ( mode ) {
434
-
435
- if( mode === this.sMode ) return;
436
-
437
- let s = this.scroller.style;
438
- let cc = this.colors
439
-
440
- switch(mode){
441
- case 0: // base
442
- s.background = cc.text;
443
- break;
444
- case 1: // over
445
- s.background = cc.select;
446
- break;
447
- case 2: // edit / down
448
- s.background = cc.select;
449
- break;
450
-
451
- }
452
-
453
- this.sMode = mode;
454
- }
455
-
456
- modeTitle ( mode ) {
457
-
458
- if( mode === this.tMode ) return;
459
-
460
- let s = this.s;
461
- let cc = this.colors
462
-
463
- switch(mode){
464
- case 0: // base
465
- s[3].color = cc.text;
466
- s[3].background = cc.button;
467
- break;
468
- case 1: // over
469
- s[3].color = cc.textOver;
470
- s[3].background = cc.overoff;
471
- break;
472
- case 2: // edit / down
473
- s[3].color = cc.textSelect;
474
- s[3].background = cc.overoff;
475
- break;
476
-
477
- }
478
-
479
- this.tMode = mode;
480
-
481
- }
482
-
483
- clearList () {
484
-
485
- while ( this.listIn.children.length ) this.listIn.removeChild( this.listIn.lastChild );
486
- this.items = [];
487
-
488
- }
489
-
490
- setList ( list ) {
491
-
492
- this.clearList();
493
-
494
- this.list = list;
495
- this.length = this.list.length;
496
-
497
- this.maxItem = this.full ? this.length : 5;
498
- this.maxItem = this.length < this.maxItem ? this.length : this.maxItem;
499
-
500
- this.maxHeight = this.maxItem * (this.itemHeight+1) + 2;
501
-
502
- this.max = this.length * (this.itemHeight+1) + 2;
503
- this.ratio = this.maxHeight / this.max;
504
- this.sh = this.maxHeight * this.ratio;
505
- this.range = this.maxHeight - this.sh;
506
-
507
- this.c[2].style.height = this.maxHeight + 'px';
508
- this.scrollerBack.style.height = this.maxHeight + 'px';
509
- this.scroller.style.height = this.sh + 'px';
510
-
511
- if( this.max > this.maxHeight ){
512
- this.ww = this.sb - this.ss;
513
- this.scroll = true;
514
- }
515
-
516
- if( this.miniCanvas ) {
517
-
518
- this.tmpCanvas = document.createElement('canvas')
519
- this.tmpCanvas.width = this.imageSize[0]
520
- this.tmpCanvas.height = this.imageSize[1]
521
- this.tmpCtx = this.tmpCanvas.getContext("2d")
522
- this.tmpCtx.fillStyle = this.canvasBg
523
- this.tmpCtx.fillRect(0, 0, this.imageSize[0], this.imageSize[1])
524
-
525
- }
526
-
527
- let item, n;//, l = this.sb;
528
- for( let i=0; i<this.length; i++ ){
529
-
530
- n = this.list[i];
531
- item = this.dom( 'div', this.css.item + 'width:'+this.ww+'px; height:'+this.itemHeight+'px; line-height:'+(this.itemHeight-5)+'px; color:'+this.colors.text+'; background:'+this.colors.back+';' );
532
- item.name = 'item'+i;
533
- item.id = i;
534
- item.select = false
535
- item.posy = (this.itemHeight+1)*i;
536
- this.listIn.appendChild( item );
537
- this.items.push( item );
538
-
539
- if( n === this.value ) this.current = item
540
-
541
- //if( this.isWithImage ) item.appendChild( this.tmpImage[n] );
542
- if( !this.isWithImage ) item.textContent = n;
543
-
544
- if( this.miniCanvas ){
545
-
546
- let c = new Image()
547
- c.src = this.tmpCanvas.toDataURL()
548
-
549
-
550
- /*let c = document.createElement('canvas')
551
-
552
- c.width = this.imageSize[0]
553
- c.height = this.imageSize[1]
554
- let ctx = c.getContext("2d")
555
- ctx.fillStyle = this.canvasBg
556
- ctx.fillRect(0, 0, this.imageSize[0], this.imageSize[1])*/
557
- c.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'
558
-
559
-
560
- //c.style.cssText = 'display:flex; align-content: flex-start; flex-wrap: wrap;'
561
- //item.style.float = 'right'
562
- item.appendChild( c )
563
-
564
- this.tmpImage[n] = c
565
-
566
- }
567
-
568
- if(this.dragout){
569
-
570
- item.img = this.tmpImage[n]
571
-
572
- item.style.pointerEvents = 'auto';
573
- item.draggable="true"
574
-
575
- item.addEventListener('dragstart', this.dragstart || function(){ /*console.log('drag start')*/})
576
- item.addEventListener('drag', this.drag || function(){ /*console.log('drag start')*/})
577
- //item.addEventListener('dragover', this);
578
- //item.addEventListener('dragenter', this);
579
- item.addEventListener('dragleave', function(){ Roots.fakeUp(); } );
580
- item.addEventListener('dragend', this.dragend || function(){ /*console.log('drag end')*/ }.bind(this) )
581
- //item.addEventListener('drop', function(){console.log('drop')})
582
-
583
- }
584
-
585
- }
586
-
587
- this.setTopItem();
588
- if( this.isSelectable ) this.selected()
589
-
590
- }
591
-
592
- drawImage( name, image, x,y,w,h ){
593
- this.tmpCtx.clearRect(0, 0, this.imageSize[0], this.imageSize[1]);
594
- this.tmpCtx.drawImage(image, x, y, w, h, 0, 0, this.imageSize[0], this.imageSize[1])
595
- this.tmpImage[name].src = this.tmpCanvas.toDataURL()
596
-
597
-
598
- /*let c = this.tmpImage[name]
599
- let ctx = c.getContext("2d")
600
- ctx.drawImage(image, x, y, w, h, 0, 0, this.imageSize[0], this.imageSize[1])*/
601
-
602
- }
603
-
604
- addImages (){
605
- let lng = this.list.length;
606
- for( let i=0; i<lng; i++ ){
607
- this.items[i].appendChild( this.tmpImage[this.list[i]] );
608
- }
609
- this.setTopItem();
610
- }
611
-
612
- setValue ( value ) {
613
-
614
- if(!isNaN(value)) this.value = this.list[ value ];
615
- else this.value = value;
616
-
617
- this.setTopItem();
618
-
619
- }
620
-
621
- setTopItem (){
622
-
623
- if(this.staticTop) return;
624
-
625
- if( this.isWithImage ){
626
-
627
- if( !this.preLoadComplete ) return;
628
-
629
- if(!this.c[3].children.length){
630
- this.canvas = document.createElement('canvas');
631
- this.canvas.width = this.imageSize[0];
632
- this.canvas.height = this.imageSize[1];
633
- this.canvas.style.cssText = 'position:absolute; top:0px; left:0px;'
634
- this.ctx = this.canvas.getContext("2d");
635
- this.c[3].appendChild( this.canvas );
636
- }
637
-
638
- let img = this.tmpImage[ this.value ];
639
- this.ctx.drawImage( this.tmpImage[ this.value ], 0, 0, this.imageSize[2], this.imageSize[3], 0,0, this.imageSize[0], this.imageSize[1] );
640
-
641
- }
642
- else this.c[3].textContent = this.value;
643
-
644
-
645
- if( this.miniCanvas ){
646
-
647
- if(!this.c[3].children.length){
648
- this.canvas = document.createElement('canvas');
649
- this.canvas.width = this.imageSize[0];
650
- this.canvas.height = this.imageSize[1];
651
- let h = ( this.h - this.imageSize[1] ) * 0.5
652
- this.canvas.style.cssText = 'position:relative; pointer-events:none; display:inline-block; float:left; margin-left:0px; margin-right:5px; top:2px'
653
- //this.canvas.style.cssText = 'position:absolute; top:'+h+'px; left:5px;'
654
- this.ctx = this.canvas.getContext("2d");
655
- this.c[3].style.textAlign = 'left'
656
- this.c[3].appendChild( this.canvas );
657
-
658
- }
659
-
660
- this.ctx.drawImage( this.tmpImage[ this.value ], 0, 0 );
661
-
662
-
663
- }
664
-
665
- }
666
-
667
-
668
- // ----- LIST
669
-
670
- update ( y ) {
671
-
672
- if( !this.scroll ) return;
673
-
674
- y = y < 0 ? 0 : y;
675
- y = y > this.range ? this.range : y;
676
-
677
- this.topList = -Math.floor( y / this.ratio );
678
-
679
- this.listIn.style.top = this.topList+'px';
680
- this.scroller.style.top = Math.floor( y ) + 'px';
681
-
682
- this.py = y;
683
-
684
- }
685
-
686
- parentHeight ( t ) {
687
-
688
- if ( this.group !== null ) this.group.calc( t );
689
- else if ( this.isUI ) this.main.calc( t );
690
-
691
- }
692
-
693
- open ( first ) {
694
-
695
- super.open();
696
-
697
- this.update( 0 )
698
-
699
- this.h = this.maxHeight + this.baseH + 5;
700
- if( !this.scroll ){
701
- this.topList = 0;
702
- this.h = this.baseH + 5 + this.max;
703
- this.scroller.style.display = 'none';
704
- this.scrollerBack.style.display = 'none';
705
- } else {
706
- this.scroller.style.display = 'block';
707
- this.scrollerBack.style.display = 'block';
708
- }
709
- this.s[0].height = this.h + 'px';
710
- this.s[2].display = 'block';
711
-
712
- if( this.up ){
713
- this.zone.y -= this.h - (this.baseH-10);
714
- this.setSvg( this.c[4], 'd', this.svgs.arrowUp );
715
- } else {
716
- this.setSvg( this.c[4], 'd', this.svgs.arrowDown );
717
- }
718
-
719
- this.rSizeContent();
720
-
721
- let t = this.h - this.baseH;
722
-
723
- this.zone.h = this.h;
724
-
725
- if(!first) this.parentHeight( t );
726
-
727
- }
728
-
729
- close () {
730
-
731
- super.close();
732
-
733
- if( this.up ) this.zone.y += this.h - (this.baseH-10);
734
-
735
- let t = this.h - this.baseH;
736
-
737
- this.h = this.baseH;
738
- this.s[0].height = this.h + 'px';
739
- this.s[2].display = 'none';
740
- this.setSvg( this.c[4], 'd', this.svgs.arrow );
741
-
742
- this.zone.h = this.h;
743
-
744
- this.parentHeight( -t );
745
-
746
- }
747
-
748
- // -----
749
-
750
- text ( txt ) {
751
-
752
- this.c[3].textContent = txt;
753
-
754
- }
755
-
756
- rSizeContent () {
757
-
758
- let i = this.length;
759
- while(i--) this.listIn.children[i].style.width = this.ww + 'px';
760
-
761
- }
762
-
763
- rSize () {
764
-
765
- super.rSize()
766
-
767
- //Proto.prototype.rSize.call( this );
768
-
769
- let s = this.s;
770
- let w = this.sb;
771
- let d = this.sa;
772
-
773
- if(s[2]=== undefined) return;
774
-
775
- s[2].width = w + 'px';
776
- s[2].left = d +'px';
777
-
778
- s[3].width = w + 'px';
779
- s[3].left = d + 'px';
780
-
781
- s[4].left = d + w - 17 + 'px';
782
-
783
- this.ww = w;
784
- if( this.max > this.maxHeight ) this.ww = w-this.ss;
785
- if(this.isOpen) this.rSizeContent();
786
-
787
- }
788
-
789
- }