// this style works, at least, just overriding an options render, // but feels a little unpleasant having to build the button up by hand again p.render = L.bind(function(view, section_id) { return E('button', { 'class': 'btn cbi-button-save', 'click': ui.createHandlerFn(this, function(blah, ev) { console.log("hit clicky click: ", blah, ev); return new Promise(function(resolve, reject) { setTimeout(function() { console.log("resolving with pleasure"); resolve("hoho joy"); }, 1000); }); }, "some string"), }, _('My buttony button')) }, this);