Skip to content

Commit 3145cbb

Browse files
committed
Updated ChatGPT tooltip x-pos (fixes adamlui/chatgpt-widescreen#214)
1 parent 6917f40 commit 3145cbb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

chatgpt-widescreen/chromium/extension/components/tooltip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Requires components/buttons.js + lib/<browser|dom>.js + <app|config|env>
1+
// Requires components/buttons.js + lib/<browser|chatgpt|dom>.js + <app|config|env>
22

33
window.tooltip = {
44

@@ -25,7 +25,7 @@ window.tooltip = {
2525
tooltip.div.style.opacity = +(event.type == 'mouseenter')
2626
},
2727

28-
update(btn) { // requires lib/browser.js + <config|env>
28+
update(btn) { // requires lib/<browser|chatgpt>.js + <config|env>
2929
if (!this.div) return
3030
const { site } = env
3131
const btnType = btn.id.replace(/-btn$/, '')
@@ -37,7 +37,7 @@ window.tooltip = {
3737
this.div.textContent = browserAPI.getMsg(`tooltip_${btnType}${
3838
!/full|wide/i.test(btnType) ? '' : (config[btnType] ? 'OFF' : 'ON')}`)
3939
this.div.style.left = `${ btnRect.left +( btnRect.width /2 ) -( this.div.offsetWidth /2 )
40-
-( site == 'chatgpt' ? 260 : 0 )}px`
40+
-( site == 'poe' ? 0 : chatgpt.sidebar.isOn() ? 260 : 52 )}px`
4141
this.div.style.top = `${ unscaledTop - this.div.offsetHeight -( site == 'chatgpt' ? -75 : /* poe */ 19 )}px`
4242
}
4343
};

chatgpt-widescreen/firefox/extension/components/tooltip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Requires components/buttons.js + lib/<browser|dom>.js + <app|config|env>
1+
// Requires components/buttons.js + lib/<browser|chatgpt|dom>.js + <app|config|env>
22

33
window.tooltip = {
44

@@ -25,7 +25,7 @@ window.tooltip = {
2525
tooltip.div.style.opacity = +(event.type == 'mouseenter')
2626
},
2727

28-
update(btn) { // requires lib/browser.js + <config|env>
28+
update(btn) { // requires lib/<browser|chatgpt>.js + <config|env>
2929
if (!this.div) return
3030
const { site } = env
3131
const btnType = btn.id.replace(/-btn$/, '')
@@ -37,7 +37,7 @@ window.tooltip = {
3737
this.div.textContent = browserAPI.getMsg(`tooltip_${btnType}${
3838
!/full|wide/i.test(btnType) ? '' : (config[btnType] ? 'OFF' : 'ON')}`)
3939
this.div.style.left = `${ btnRect.left +( btnRect.width /2 ) -( this.div.offsetWidth /2 )
40-
-( site == 'chatgpt' ? 260 : 0 )}px`
40+
-( site == 'poe' ? 0 : chatgpt.sidebar.isOn() ? 260 : 52 )}px`
4141
this.div.style.top = `${ unscaledTop - this.div.offsetHeight -( site == 'chatgpt' ? -75 : /* poe */ 19 )}px`
4242
}
4343
};

0 commit comments

Comments
 (0)