mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1852866 [Button placed over text](https://bugs.launchpad.net/calibre/+bug/1852866)
This commit is contained in:
parent
941e31aa46
commit
144d17ef68
@ -61,13 +61,13 @@ def create_location_overlay(current_position_data, overlay, container):
|
|||||||
current_cfi = current_position_data.cfi
|
current_cfi = current_position_data.cfi
|
||||||
if current_cfi:
|
if current_cfi:
|
||||||
container.appendChild(E.div(
|
container.appendChild(E.div(
|
||||||
style='margin: 1rem; display: flex; align-items: baseline',
|
style='margin: 1rem; margin-bottom: calc(1rem - 1ex); display: flex; align-items: baseline; flex-wrap: wrap',
|
||||||
E.input(
|
E.div(
|
||||||
type='text', readonly='readonly', value=_('Current location: {}').format(current_cfi), name='current_location',
|
_('Current location: {}').format(current_cfi),
|
||||||
style='border-width: 0; background-color: transparent; outline: none; flex-grow: 10; font-family: inherit'
|
style='flex-grow: 10; text-overflow: ellipsis; margin-bottom: 1ex'
|
||||||
),
|
),
|
||||||
create_button(_('Copy'), action=def():
|
create_button(_('Copy'), action=def():
|
||||||
src = document.querySelector(f'#{container_id} [name=current_location]')
|
src = document.querySelector(f'#{container_id} input')
|
||||||
orig = src.value
|
orig = src.value
|
||||||
src.value = current_cfi
|
src.value = current_cfi
|
||||||
src.focus()
|
src.focus()
|
||||||
@ -76,7 +76,6 @@ def create_location_overlay(current_position_data, overlay, container):
|
|||||||
document.execCommand('copy')
|
document.execCommand('copy')
|
||||||
finally:
|
finally:
|
||||||
src.value = orig
|
src.value = orig
|
||||||
src.blur()
|
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ def create_location_overlay(current_position_data, overlay, container):
|
|||||||
container.appendChild(E.div(
|
container.appendChild(E.div(
|
||||||
style='margin: 1rem;',
|
style='margin: 1rem;',
|
||||||
E.div(
|
E.div(
|
||||||
style='display: flex; align-items: baseline',
|
style='display: flex; align-items: baseline; flex-wrap: wrap',
|
||||||
E.label(_('Go to:'), style='margin-right: 1rem'),
|
E.label(_('Go to:'), style='margin-right: 1rem'),
|
||||||
E.input(name='newpos', type='text', min='0', max=str(current_position_data.book_length), step='0.1', style='flex-grow: 10; margin-right: 1rem', onkeydown=def(ev):
|
E.input(name='newpos', type='text', min='0', max=str(current_position_data.book_length), step='0.1', style='flex-grow: 10; margin-right: 1rem', onkeydown=def(ev):
|
||||||
if ev.key is 'Enter':
|
if ev.key is 'Enter':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user