From 3200770adaef7509a9ee9d3f234b7d815d144884 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Sun, 4 Jan 2015 23:13:05 -0500 Subject: [PATCH] Afaict the modal code was not used anywhere --- js/gratipay/modal.js | 52 -------------------------------------------- scss/gratipay.scss | 1 - scss/modals.scss | 30 ------------------------- 3 files changed, 83 deletions(-) delete mode 100644 js/gratipay/modal.js delete mode 100644 scss/modals.scss diff --git a/js/gratipay/modal.js b/js/gratipay/modal.js deleted file mode 100644 index d97990d2ee..0000000000 --- a/js/gratipay/modal.js +++ /dev/null @@ -1,52 +0,0 @@ -Gratipay.modal = {}; - -/** - * Confirm dialog - * - * @example - * Gratipay.modal.confirm({ - * message: 'Error.', - * yes: 'Yes', // optional - * no: 'No', // optional - * selected: 'yes', // optional, one of yes/no - * callback: function(confirmed) { - * if (confirmed) { - * // user clicked `yes` - * } else { - * // user clicked `no` - * } - * }, - * }); - * - * @param {object} options - */ -Gratipay.modal.confirm = function(options) { - var message = options.message; - var callback = options.callback; - var yesText = options.yes || 'Yes'; - var noText = options.no || 'No'; - var selected = (options.selected || 'yes').toLowerCase(); - - var dialog = Gratipay.jsonml(['div', { 'class': 'modal modal-confirm' }, - ['p', message], - - ['div', { 'class': 'controls' }, - ['button', { 'class': 'dialog-yes' }, yesText], ' ', - ['button', { 'class': 'dialog-no' }, noText], - ], - ]); - - $(dialog).find('.controls button').click(function() { - if (typeof callback == 'function') - callback($(this).hasClass('dialog-yes')); - - $(dialog).remove(); - }); - - if (!$('#modal-bg').length) - $('body').append(''); - - $('#modal-bg').before(dialog); - - $(dialog).find('.dialog-' + selected).addClass('selected').focus(); -}; diff --git a/scss/gratipay.scss b/scss/gratipay.scss index 106c166447..e854d1cec9 100644 --- a/scss/gratipay.scss +++ b/scss/gratipay.scss @@ -15,7 +15,6 @@ @import "variables"; @import "utils"; @import "buttons-knobs"; -@import "modals"; @import "notifications"; @import "modules"; // bigger than a knob, but used in multiple places @import "elements"; // specific HTML elements (body, p, etc.) diff --git a/scss/modals.scss b/scss/modals.scss deleted file mode 100644 index bd7e806c9f..0000000000 --- a/scss/modals.scss +++ /dev/null @@ -1,30 +0,0 @@ -body > .modal { - z-index: 901; - - position: fixed; - top: 50%; - left: 50%; - - width: 400px; - margin: -50px 0 0 -200px; - padding: 20px 20px 10px; - - background: $lighter-gray; - border: 5px solid transparentize($brown, 0.8); - @include border-radius(5px); - - .controls { - text-align: right; - } - - & ~ #modal-bg { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 900; - - background: transparentize($light-brown, 0.2); - } -}