@@ -83,27 +83,31 @@ export class SpeedDialItem extends SpeedDialItemBase {
83
83
public actualActive = false ;
84
84
mTitleView : WeakRef < SpeedDialItemTitle > ;
85
85
mButton : WeakRef < SpeedDialItemButton > ;
86
- fabmenu : WeakRef < SpeedDial > ;
86
+ mFabmenu : WeakRef < SpeedDial > ;
87
87
88
88
get titleView ( ) {
89
89
return this . mTitleView ?. get ( ) ;
90
90
}
91
91
get button ( ) {
92
92
return this . mButton ?. get ( ) ;
93
93
}
94
+ get fabmenu ( ) {
95
+ return this . mFabmenu ?. get ( ) ;
96
+ }
94
97
constructor ( size = 'mini' , private isMain = false ) {
95
98
super ( ) ;
96
- // this._fabsHolder.isPassThroughParentEnabled = true;
97
99
this . isPassThroughParentEnabled = true ;
98
100
const titleView = new SpeedDialItemTitle ( ) ;
99
101
titleView . notify = this . notifyChildEvent ( titleView , titleView . notify ) ;
100
102
titleView . col = 1 ;
101
- titleView . text = this . title ;
103
+ // titleView.text = this.title;
104
+ this . mTitleView = new WeakRef ( titleView ) ;
102
105
const button = isMain ? new SpeedDialButton ( ) : new SpeedDialItemButton ( ) ;
103
106
button . notify = this . notifyChildEvent ( button , button . notify ) ;
104
107
button . horizontalAlignment = 'center' ;
105
108
// this.fabButtonTitle.style['css:elevation'] = 4;this.fabButtonTitle.style['css:elevation'] = 2;
106
109
button . col = this . fabButtonCol ;
110
+ this . mButton = new WeakRef ( button ) ;
107
111
if ( size === 'mini' ) {
108
112
// button.style['css:border-radius'] = 20;
109
113
button . style [ 'css:width' ] = 40 ;
@@ -118,8 +122,6 @@ export class SpeedDialItem extends SpeedDialItemBase {
118
122
( this as any ) . columns = this . fabColumns ;
119
123
this . addChild ( titleView ) ;
120
124
this . addChild ( button ) ;
121
- this . mTitleView = new WeakRef ( titleView ) ;
122
- this . mButton = new WeakRef ( button ) ;
123
125
}
124
126
updateAlignment ( ) {
125
127
( this as any ) . columns = this . fabColumns ;
@@ -141,9 +143,9 @@ export class SpeedDialItem extends SpeedDialItemBase {
141
143
( data as any ) . speeddialItem = this ;
142
144
if ( data . eventName === 'tap' ) {
143
145
if ( this . isMain ) {
144
- this . fabmenu . get ( ) . onButtonTap ( data ) ;
146
+ this . fabmenu . onButtonTap ( data ) ;
145
147
} else {
146
- this . fabmenu . get ( ) . active = false ;
148
+ this . fabmenu . active = false ;
147
149
}
148
150
}
149
151
superNotifyMethod . call ( child , data ) ;
@@ -154,27 +156,27 @@ export class SpeedDialItem extends SpeedDialItemBase {
154
156
}
155
157
onButtonTap ( args ) {
156
158
if ( this . isMain ) {
157
- this . fabmenu . get ( ) . onButtonTap ( args ) ;
159
+ this . fabmenu . onButtonTap ( args ) ;
158
160
} else {
159
161
this . notify ( { object : this , ...args } ) ;
160
- this . fabmenu . get ( ) . active = false ;
162
+ this . fabmenu . active = false ;
161
163
}
162
164
}
163
165
get isLeft ( ) {
164
- return this . fabmenu && this . fabmenu . get ( ) . isLeft ;
166
+ return this . mFabmenu && this . fabmenu . isLeft ;
165
167
}
166
168
get isRight ( ) {
167
- return this . fabmenu && this . fabmenu . get ( ) . isRight ;
169
+ return this . mFabmenu && this . fabmenu . isRight ;
168
170
}
169
171
get fabColumns ( ) {
170
172
return this . isRight ? '*,auto,60' : '60,auto,*' ;
171
173
}
172
174
get active ( ) {
173
- return this . fabmenu && this . fabmenu . get ( ) . active ;
175
+ return this . mFabmenu && this . fabmenu . active ;
174
176
}
175
177
set active ( value ) {
176
- if ( this . fabmenu ) {
177
- this . fabmenu . get ( ) . active = value ;
178
+ if ( this . mFabmenu ) {
179
+ this . fabmenu . active = value ;
178
180
}
179
181
}
180
182
@@ -258,14 +260,14 @@ export class SpeedDialItem extends SpeedDialItemBase {
258
260
259
261
@CSSType ( 'MDSpeedDial' )
260
262
export class SpeedDial extends SpeedDialItemBase {
261
- mFabs : WeakRef < SpeedDialItem > [ ] = [ ] ;
263
+ private mFabs : WeakRef < SpeedDialItem > [ ] = [ ] ;
262
264
private mFabsHolder : WeakRef < FlexboxLayout > ;
265
+ private mFabMainButton : WeakRef < SpeedDialItem > ;
263
266
rows : string ;
264
267
columns : string ;
265
268
orientation = 'vertical' ;
266
269
isActive = false ;
267
270
actualActive = false ;
268
- private mFabMainButton : WeakRef < SpeedDialItem > ;
269
271
270
272
get fabsHolder ( ) {
271
273
return this . mFabsHolder ?. get ( ) ;
@@ -284,25 +286,25 @@ export class SpeedDial extends SpeedDialItemBase {
284
286
this . rows = 'auto,*,auto,auto' ;
285
287
this . style [ 'css:padding-left' ] = 8 ;
286
288
this . style [ 'css:padding-right' ] = 8 ;
287
- const fabHolder = new FlexboxLayout ( ) ;
288
- fabHolder . row = 2 ;
289
- fabHolder . horizontalAlignment = this . horizontalAlignment ;
289
+ const fabsHolder = new FlexboxLayout ( ) ;
290
+ fabsHolder . row = 2 ;
291
+ fabsHolder . horizontalAlignment = this . horizontalAlignment ;
290
292
this . isPassThroughParentEnabled = true ;
291
293
if ( global . isIOS ) {
292
- fabHolder . isPassThroughParentEnabled = true ;
294
+ fabsHolder . isPassThroughParentEnabled = true ;
293
295
}
294
- fabHolder . flexDirection = this . orientation === 'vertical' ? 'column-reverse' : 'row-reverse' ;
295
- fabHolder . visibility = 'hidden' ;
296
+ fabsHolder . flexDirection = this . orientation === 'vertical' ? 'column-reverse' : 'row-reverse' ;
297
+ fabsHolder . visibility = 'hidden' ;
296
298
this . backgroundColor = new Color ( '#00000000' ) ;
297
299
298
300
const fabMainButton = new SpeedDialItem ( null , true ) ;
299
301
this . prepareItem ( fabMainButton , true ) ;
300
302
fabMainButton . row = 3 ;
301
303
302
- this . addChild ( fabMainButton ) ;
303
- this . addChild ( fabHolder ) ;
304
- this . mFabsHolder = new WeakRef ( fabHolder ) ;
304
+ this . mFabsHolder = new WeakRef ( fabsHolder ) ;
305
305
this . mFabMainButton = new WeakRef ( fabMainButton ) ;
306
+ this . addChild ( fabMainButton ) ;
307
+ this . addChild ( fabsHolder ) ;
306
308
}
307
309
308
310
get backDrop ( ) {
@@ -319,7 +321,7 @@ export class SpeedDial extends SpeedDialItemBase {
319
321
}
320
322
321
323
prepareItem ( item : SpeedDialItem , isMain = false ) {
322
- item . fabmenu = new WeakRef ( this ) ;
324
+ item . mFabmenu = new WeakRef ( this ) ;
323
325
const animationData = this . computeAnimationData ( 'hide' , item , this . fabs . length , Math . max ( this . fabs . length , 1 ) , OPEN_DURATION , isMain ) ;
324
326
transformAnimationValues ( animationData ) . forEach ( ( d ) => {
325
327
const { target, ...others } = d ;
@@ -560,7 +562,7 @@ export class SpeedDial extends SpeedDialItemBase {
560
562
}
561
563
//@ts -ignore
562
564
get horizontalAlignment ( ) {
563
- return this . fabsHolder . horizontalAlignment ;
565
+ return this . fabsHolder ? .horizontalAlignment ;
564
566
}
565
567
set horizontalAlignment ( value ) {
566
568
this . fabsHolder . horizontalAlignment = value ;
0 commit comments