createHandlerFn(ctx, fn, ...args) {
		if (typeof(fn) == 'string')
			fn = ctx[fn];

		if (typeof(fn) != 'function')
			return null;

		return L.bind(function() {
			const t = arguments[args.length].currentTarget;

			t.classList.add('spinning');
			t.disabled = true;

			if (t.blur)
				t.blur();

			Promise.resolve(fn.apply(ctx, arguments)).finally(() => {
				t.classList.remove('spinning');
				t.disabled = false;
			});
		}, ctx, ...args);
	}
Create a pre-bound event handler function.

Generate and bind a function suitable for use in event handlers. The
generated function automatically disables the event source element
and adds an active indication to it by adding appropriate CSS classes.

It will also await any promises returned by the wrapped function and
re-enable the source element after the promises ran to completion.

@param {*} ctx
The `this` context to use for the wrapped function.

@param {function|string} fn
Specifies the function to wrap. In case of a function value, the
function is used as-is. If a string is specified instead, it is looked
up in `ctx` to obtain the function to wrap. In both cases the bound
function will be invoked with `ctx` as `this` context

@param {...*} extra_args
Any further parameter as passed as-is to the bound event handler
function in the same order as passed to `createHandlerFn()`.

@returns {function|null}
Returns the pre-bound handler function which is suitable to be passed
to `addEventListener()`. Returns `null` if the given `fn` argument is
a string which could not be found in `ctx` or if `ctx[fn]` is not a
valid function value.