Skip to content

Commit 52fb221

Browse files
committed
Expanded Site Settings entry highlight on hover full-width, condensed onmouse<enter|leave> handler ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-widescreen]
1 parent d846ccf commit 52fb221

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

chromium/extension/popup/controller.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@
166166

167167
// Init entry's elems
168168
const ssEntry = {
169-
div: dom.create.elem('div', { class: 'menu-entry' }),
169+
div: dom.create.elem('div', { class: 'menu-entry highlight-on-hover' }),
170170
switchLabelDiv: dom.create.elem('div', {
171-
class: 'highlight-on-hover',
172171
title: `${getMsg('helptip_run')} ${app.name} on ${sites[site].urls.homepage}`,
173172
style: `display: flex ; height: 33px ; align-items: center ; flex-grow: 1 ;
174173
margin-left: -2px ; padding-left: 2px /* fill .menu-entry left-padding */` }),
@@ -199,8 +198,8 @@
199198
getMsg(`state_${ extensionIsDisabled() ? 'off' : 'on' }`).toUpperCase()}`)
200199
}
201200
}
202-
ssEntry.faviconDiv.onmouseenter = ssEntry.faviconDiv.onmouseleave = ({ type }) => // swap favicon/open icon
203-
ssEntry.faviconDiv.firstChild.replaceWith(type == 'mouseenter' ? ssEntry.openIcon : ssEntry.favicon)
201+
ssEntry.faviconDiv.onmouseenter = ssEntry.faviconDiv.onmouseleave = ({ type }) =>
202+
ssEntry.faviconDiv.firstChild.replaceWith(ssEntry[type == 'mouseenter' ? 'openIcon' : 'favicon'])
204203
ssEntry.faviconDiv.onclick = () => { open(`https://${sites[site].urls.homepage}`) ; close() }
205204
}
206205

firefox/extension/popup/controller.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@
166166

167167
// Init entry's elems
168168
const ssEntry = {
169-
div: dom.create.elem('div', { class: 'menu-entry' }),
169+
div: dom.create.elem('div', { class: 'menu-entry highlight-on-hover' }),
170170
switchLabelDiv: dom.create.elem('div', {
171-
class: 'highlight-on-hover',
172171
title: `${getMsg('helptip_run')} ${app.name} on ${sites[site].urls.homepage}`,
173172
style: `display: flex ; height: 33px ; align-items: center ; flex-grow: 1 ;
174173
margin-left: -2px ; padding-left: 2px /* fill .menu-entry left-padding */` }),
@@ -199,8 +198,8 @@
199198
getMsg(`state_${ extensionIsDisabled() ? 'off' : 'on' }`).toUpperCase()}`)
200199
}
201200
}
202-
ssEntry.faviconDiv.onmouseenter = ssEntry.faviconDiv.onmouseleave = ({ type }) => // swap favicon/open icon
203-
ssEntry.faviconDiv.firstChild.replaceWith(type == 'mouseenter' ? ssEntry.openIcon : ssEntry.favicon)
201+
ssEntry.faviconDiv.onmouseenter = ssEntry.faviconDiv.onmouseleave = ({ type }) =>
202+
ssEntry.faviconDiv.firstChild.replaceWith(ssEntry[type == 'mouseenter' ? 'openIcon' : 'favicon'])
204203
ssEntry.faviconDiv.onclick = () => { open(`https://${sites[site].urls.homepage}`) ; close() }
205204
}
206205

0 commit comments

Comments
 (0)