@@ -10,11 +10,11 @@ export class HoverBox {
10
10
/**
11
11
* Setup hoverbox events and start listening
12
12
* @param selector The selector to find the child that contains the text to show
13
- * @param defaultOptions The default options to apply
13
+ * @param options The default options to apply
14
14
*/
15
- constructor ( selector : string , defaultOptions ?: HoverOptions ) {
15
+ constructor ( selector : string , options ?: HoverOptions ) {
16
16
this . _selector = selector ;
17
- this . _options = Object . assign ( { } , defaultOptions ) ;
17
+ this . _options = Object . assign ( { } , options ) ;
18
18
this . _timeouts = { } ;
19
19
20
20
this . startListening ( ) ;
@@ -65,7 +65,7 @@ export class HoverBox {
65
65
private handleHoverBoxAnimation ( t : HTMLElement , showOrHide : 'show' | 'hide' ) : void {
66
66
const hoverBox = this . getHoverBox ( t , showOrHide ) ;
67
67
68
- if ( hoverBox === null ) {
68
+ if ( ! hoverBox ) {
69
69
return ;
70
70
}
71
71
@@ -79,9 +79,9 @@ export class HoverBox {
79
79
at : this . _options . at ?? 'bottom center' ,
80
80
anchor : t ,
81
81
target : hoverBox ,
82
- collision : this . _options ? .collision ,
83
- bestFitPreference : this . _options ? .bestFitPreference ,
84
- defaults : this . _options ? .defaults ,
82
+ collision : this . _options . collision ,
83
+ bestFitPreference : this . _options . bestFitPreference ,
84
+ defaults : this . _options . defaults ,
85
85
} ) ;
86
86
87
87
// apply new position
0 commit comments