From 3a76e84286635b79d91762417b771f9662a1737e Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 20 Sep 2019 15:26:58 +0200 Subject: [PATCH] Add new modal type --- www/common/common-interface.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index a2694c156..72851a8cc 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -551,6 +551,30 @@ define([ }); }; + UI.proposal = function (content, cb) { + var buttons = [{ + name: Messages.friendRequest_later, + onClick: function () {}, + keys: [27] + }, { + className: 'primary', + name: Messages.friendRequest_accept, + onClick: function () { + cb(true); + }, + keys: [13] + }, { + className: 'primary', + name: Messages.friendRequest_decline, + onClick: function () { + cb(false); + }, + keys: [[13, 'ctrl']] + }]; + var modal = dialog.customModal(content, {buttons: buttons}); + UI.openCustomModal(modal); + }; + UI.log = function (msg) { Alertify.success(Util.fixHTML(msg)); };