mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix editor being closed on resize
This commit is contained in:
parent
95248db34e
commit
136a9f64ec
@ -500,16 +500,19 @@ class SelectionBar:
|
|||||||
|
|
||||||
def update_position(self):
|
def update_position(self):
|
||||||
container = self.container
|
container = self.container
|
||||||
|
cs = self.view.currently_showing.selection
|
||||||
self.bar.style.display = 'none'
|
self.bar.style.display = 'none'
|
||||||
self.editor.style.display = 'none'
|
|
||||||
self.set_handle_colors()
|
self.set_handle_colors()
|
||||||
if self.state is DRAGGING:
|
if self.state is DRAGGING:
|
||||||
self.show()
|
self.show()
|
||||||
return
|
return
|
||||||
|
if self.state is EDITING:
|
||||||
|
self.show()
|
||||||
|
return
|
||||||
self.left_handle.style.display = 'none'
|
self.left_handle.style.display = 'none'
|
||||||
self.right_handle.style.display = 'none'
|
self.right_handle.style.display = 'none'
|
||||||
|
self.editor.style.display = 'none'
|
||||||
|
|
||||||
cs = self.view.currently_showing.selection
|
|
||||||
if not cs or cs.empty or jstype(cs.drag_mouse_position.x) is 'number':
|
if not cs or cs.empty or jstype(cs.drag_mouse_position.x) is 'number':
|
||||||
return self.hide()
|
return self.hide()
|
||||||
|
|
||||||
@ -522,8 +525,6 @@ class SelectionBar:
|
|||||||
return {'x': (x.x or 0) + margins.left, 'y': (x.y or 0) + margins.top, 'height': x.height or 0, 'onscreen': x.onscreen}
|
return {'x': (x.x or 0) + margins.left, 'y': (x.y or 0) + margins.top, 'height': x.height or 0, 'onscreen': x.onscreen}
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
if self.state is EDITING:
|
|
||||||
return
|
|
||||||
self.bar.style.display = self.left_handle.style.display = self.right_handle.style.display = 'block'
|
self.bar.style.display = self.left_handle.style.display = self.right_handle.style.display = 'block'
|
||||||
start = map_boundary(cs.start)
|
start = map_boundary(cs.start)
|
||||||
end = map_boundary(cs.end)
|
end = map_boundary(cs.end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user