mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Update RapydScript
This commit is contained in:
parent
461a358d7a
commit
0d5341a31b
2 changed files with 7 additions and 1 deletions
Binary file not shown.
|
|
@ -60,7 +60,13 @@ def E(tag, *args, **kwargs):
|
|||
|
||||
for attr in kwargs:
|
||||
vattr = str.replace(str.rstrip(attr, '_'), '_', '-')
|
||||
ans.setAttribute(vattr, kwargs[attr])
|
||||
val = kwargs[attr]
|
||||
if callable(val):
|
||||
if str.startswith(attr, 'on'):
|
||||
attr = attr[2:]
|
||||
ans.addEventListener(attr, val)
|
||||
else:
|
||||
ans.setAttribute(vattr, val)
|
||||
|
||||
for arg in args:
|
||||
if type(arg) == 'string':
|
||||
|
|
|
|||
Loading…
Reference in a new issue