Sha256: 62bbbfa3cd7923c70382f83c69f1f9e9bf532364d0e735244dfc5dbd2697e170
Contents?: true
Size: 949 Bytes
Versions: 66
Compression:
Stored size: 949 Bytes
Contents
// = require ./progressFixed // = require_self $(() => { const $projects = $('#projects, #project'); const $budgetSummaryTotal = $('.budget-summary__total'); const $budgetExceedModal = $('#budget-excess'); const totalBudget = parseInt($budgetSummaryTotal.attr('data-total-budget'), 10); const cancelEvent = (event) => { event.stopPropagation(); event.preventDefault(); }; $projects.on('click', '.budget--list__action', (event) => { const currentBudget = parseInt($('.budget-summary__progressbox').attr('data-current-budget'), 10); const $currentTarget = $(event.currentTarget); const projectBudget = parseInt($currentTarget.attr('data-budget'), 10); if ($currentTarget.attr('disabled')) { cancelEvent(event); } else if ($currentTarget.attr('data-add') && ((currentBudget + projectBudget) > totalBudget)) { $budgetExceedModal.foundation('toggle'); cancelEvent(event); } }); });
Version data entries
66 entries across 66 versions & 2 rubygems