@@ -22,15 +22,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
22
22
23
23
const $ = dom . $ ;
24
24
25
- function elementsOverlapHorizontally ( el1 : HTMLElement , el2 : HTMLElement ) {
26
- const domRect1 = el1 . getBoundingClientRect ( ) ;
27
- const domRect2 = el2 . getBoundingClientRect ( ) ;
28
- return ! (
29
- domRect1 . right < domRect2 . left ||
30
- domRect1 . left > domRect2 . right
31
- ) ;
32
- }
33
-
34
25
export class ColorPickerHeader extends Disposable {
35
26
36
27
private readonly _domNode : HTMLElement ;
@@ -48,7 +39,8 @@ export class ColorPickerHeader extends Disposable {
48
39
49
40
this . _pickedColorNode = dom . append ( this . _domNode , $ ( '.picked-color' ) ) ;
50
41
this . _pickedColorRepresentation = dom . append ( this . _pickedColorNode , document . createElement ( 'div' ) ) ;
51
- const icon = dom . append ( this . _pickedColorNode , $ ( '.codicon.codicon-color-mode' ) ) ;
42
+ this . _pickedColorRepresentation . classList . add ( 'picked-color-representation' ) ;
43
+ dom . append ( this . _pickedColorNode , $ ( '.codicon.codicon-color-mode' ) ) ;
52
44
53
45
const tooltip = localize ( 'clickToToggleColorOptions' , "Click to toggle color options (rgb/hsl/hex)" ) ;
54
46
this . _pickedColorNode . setAttribute ( 'title' , tooltip ) ;
@@ -78,16 +70,6 @@ export class ColorPickerHeader extends Disposable {
78
70
this . _domNode . classList . add ( 'standalone-colorpicker' ) ;
79
71
this . _closeButton = this . _register ( new CloseButton ( this . _domNode ) ) ;
80
72
}
81
-
82
- const resizeObserver = new ResizeObserver ( ( ) => {
83
- this . _pickedColorRepresentation . style . display = 'block' ;
84
- if ( elementsOverlapHorizontally ( this . _pickedColorRepresentation , icon ) ) {
85
- this . _pickedColorRepresentation . style . display = 'none' ;
86
- } else {
87
- this . _pickedColorRepresentation . style . display = 'block' ;
88
- }
89
- } ) ;
90
- resizeObserver . observe ( this . _domNode ) ;
91
73
}
92
74
93
75
public get domNode ( ) : HTMLElement {
0 commit comments