Revision 7218849a
Added by koszko over 1 year ago
html/dialog.js | ||
---|---|---|
131 | 131 |
#EXPORT loader |
132 | 132 |
|
133 | 133 |
/* |
134 |
* Wrapper around target.addEventListener() that makes the requested callback
|
|
135 |
* only execute if dialog is not shown.
|
|
134 |
* Wrapper the requested callback into one that only executes it if dialog is
|
|
135 |
* not shown. |
|
136 | 136 |
*/ |
137 |
function onevent(ctx, target, event, cb)
|
|
137 |
function when_hidden(ctx, cb)
|
|
138 | 138 |
{ |
139 |
target.addEventListener(event, e => !ctx.shown && cb(e)); |
|
139 |
function wrapped_cb(...args) { |
|
140 |
if (!ctx.shown) |
|
141 |
return cb(...args); |
|
142 |
} |
|
143 |
return wrapped_cb; |
|
140 | 144 |
} |
141 |
#EXPORT onevent |
|
145 |
#EXPORT when_hidden |
Also available in: Unified diff
add a mapping/resources installation dialog