mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix inserting image
This commit is contained in:
parent
53834220da
commit
249751fddd
1 changed files with 6 additions and 3 deletions
|
@ -540,10 +540,13 @@ class FactEditor(object):
|
||||||
file = ui.utils.getFile(self.parent, _("Add an image"), "picture", key)
|
file = ui.utils.getFile(self.parent, _("Add an image"), "picture", key)
|
||||||
if not file:
|
if not file:
|
||||||
return
|
return
|
||||||
self._addPicture(file)
|
self._addPicture(file, widget=w)
|
||||||
|
|
||||||
def _addPicture(self, file):
|
def _addPicture(self, file, widget=None):
|
||||||
w = self.focusedEdit()
|
if widget:
|
||||||
|
w = widget
|
||||||
|
else:
|
||||||
|
w = self.focusedEdit()
|
||||||
path = self.deck.addMedia(file)
|
path = self.deck.addMedia(file)
|
||||||
w.insertHtml('<img src="%s">' % path)
|
w.insertHtml('<img src="%s">' % path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue