@@ -121,11 +121,11 @@ export default class ModalDialog {
121
121
this . closeDiv . setAttribute ( "role" , "button" ) ;
122
122
this . closeDiv . setAttribute ( "tabindex" , 3 ) ;
123
123
// Apply styles and events after the creation as createElement doesn't process them correctly
124
- let generalStyle = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( closeIcon ) } )` ;
125
- let hoverStyle = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( closeHoverIcon ) } )` ;
126
- this . closeDiv . setAttribute ( "style" , generalStyle ) ;
127
- this . closeDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
128
- this . closeDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
124
+ const generalStyleClose = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( closeIcon ) } )` ;
125
+ const hoverStyleClose = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( closeHoverIcon ) } )` ;
126
+ this . closeDiv . setAttribute ( "style" , generalStyleClose ) ;
127
+ this . closeDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyleClose ) ) ;
128
+ this . closeDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyleClose ) ) ;
129
129
// To identifiy the element in automated testing
130
130
this . closeDiv . setAttribute ( "data-testid" , "mtcteditor-close-button" ) ;
131
131
@@ -136,11 +136,11 @@ export default class ModalDialog {
136
136
this . stackDiv = Util . createElement ( "a" , attributes ) ;
137
137
this . stackDiv . setAttribute ( "role" , "button" ) ;
138
138
this . stackDiv . setAttribute ( "tabindex" , 2 ) ;
139
- generalStyle = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minsIcon ) } )` ;
140
- hoverStyle = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minsHoverIcon ) } )` ;
141
- this . stackDiv . setAttribute ( "style" , generalStyle ) ;
142
- this . stackDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
143
- this . stackDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
139
+ const generalStyleStack = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minsIcon ) } )` ;
140
+ const hoverStyleStack = `background-size: 10px; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minsHoverIcon ) } )` ;
141
+ this . stackDiv . setAttribute ( "style" , generalStyleStack ) ;
142
+ this . stackDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyleStack ) ) ;
143
+ this . stackDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyleStack ) ) ;
144
144
// To identifiy the element in automated testing
145
145
this . stackDiv . setAttribute ( "data-testid" , "mtcteditor-fullscreen-disable-button" ) ;
146
146
@@ -151,11 +151,11 @@ export default class ModalDialog {
151
151
this . maximizeDiv = Util . createElement ( "a" , attributes ) ;
152
152
this . maximizeDiv . setAttribute ( "role" , "button" ) ;
153
153
this . maximizeDiv . setAttribute ( "tabindex" , 2 ) ;
154
- generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( fullsIcon ) } )` ;
155
- hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( fullsHoverIcon ) } )` ;
156
- this . maximizeDiv . setAttribute ( "style" , generalStyle ) ;
157
- this . maximizeDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
158
- this . maximizeDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
154
+ const generalStyleMaximize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( fullsIcon ) } )` ;
155
+ const hoverStyleMaximize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( fullsHoverIcon ) } )` ;
156
+ this . maximizeDiv . setAttribute ( "style" , generalStyleMaximize ) ;
157
+ this . maximizeDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyleMaximize ) ) ;
158
+ this . maximizeDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyleMaximize ) ) ;
159
159
// To identifiy the element in automated testing
160
160
this . maximizeDiv . setAttribute ( "data-testid" , "mtcteditor-fullscreen-enable-button" ) ;
161
161
@@ -166,11 +166,11 @@ export default class ModalDialog {
166
166
this . minimizeDiv = Util . createElement ( "a" , attributes ) ;
167
167
this . minimizeDiv . setAttribute ( "role" , "button" ) ;
168
168
this . minimizeDiv . setAttribute ( "tabindex" , 1 ) ;
169
- generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minIcon ) } )` ;
170
- hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minHoverIcon ) } )` ;
171
- this . minimizeDiv . setAttribute ( "style" , generalStyle ) ;
172
- this . minimizeDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
173
- this . minimizeDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
169
+ const generalStyleMinimize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minIcon ) } )` ;
170
+ const hoverStyleMinimize = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minHoverIcon ) } )` ;
171
+ this . minimizeDiv . setAttribute ( "style" , generalStyleMinimize ) ;
172
+ this . minimizeDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyleMinimize ) ) ;
173
+ this . minimizeDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyleMinimize ) ) ;
174
174
// To identify the element in automated testing
175
175
this . minimizeDiv . setAttribute ( "data-testid" , "mtcteditor-minimize-button" ) ;
176
176
@@ -797,8 +797,8 @@ export default class ModalDialog {
797
797
const generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minIcon ) } )` ;
798
798
const hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minHoverIcon ) } )` ;
799
799
this . minimizeDiv . setAttribute ( "style" , generalStyle ) ;
800
- this . minimizeDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
801
- this . minimizeDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
800
+ this . minimizeDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyle ) ) ;
801
+ this . minimizeDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyle ) ) ;
802
802
803
803
this . restoreModalProperties ( ) ;
804
804
@@ -848,8 +848,8 @@ export default class ModalDialog {
848
848
const generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( maxIcon ) } )` ;
849
849
const hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( maxHoverIcon ) } )` ;
850
850
this . minimizeDiv . setAttribute ( "style" , generalStyle ) ;
851
- this . minimizeDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
852
- this . minimizeDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
851
+ this . minimizeDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyle ) ) ;
852
+ this . minimizeDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyle ) ) ;
853
853
}
854
854
}
855
855
@@ -881,8 +881,8 @@ export default class ModalDialog {
881
881
const generalStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minIcon ) } )` ;
882
882
const hoverStyle = `background-size: 10px; background-repeat: no-repeat; background-image: url(data:image/svg+xml;base64,${ window . btoa ( minHoverIcon ) } )` ;
883
883
this . minimizeDiv . setAttribute ( "style" , generalStyle ) ;
884
- this . minimizeDiv . setAttribute ( "onmouseover ", `this. style = " ${ hoverStyle } ";` ) ;
885
- this . minimizeDiv . setAttribute ( "onmouseout ", `this. style = " ${ generalStyle } ";` ) ;
884
+ this . minimizeDiv . addEventListener ( "mouseover ", ( e ) => ( e . target . style = hoverStyle ) ) ;
885
+ this . minimizeDiv . addEventListener ( "mouseout ", ( e ) => ( e . target . style = generalStyle ) ) ;
886
886
887
887
// Set size to 80% screen with a max size.
888
888
this . setSize ( parseInt ( window . innerHeight * 0.8 , 10 ) , parseInt ( window . innerWidth * 0.8 , 10 ) ) ;
0 commit comments