Added js file for alert

This commit is contained in:
María Checa
2018-01-15 23:19:19 +01:00
committed by Bertocq
parent 7db0d832d9
commit 4e5c8f4903
2 changed files with 9 additions and 0 deletions

View File

@@ -74,6 +74,7 @@
//= require polls
//= require sortable
//= require table_sortable
//= require investment_report_alert
var initialize_modules = function() {
App.Comments.initialize();
@@ -115,6 +116,7 @@ var initialize_modules = function() {
App.Polls.initialize();
App.Sortable.initialize();
App.TableSortable.initialize();
App.InvestmentReportAlert.initialize();
};
$(function(){

View File

@@ -0,0 +1,7 @@
App.InvestmentReportAlert =
initialize: ->
$('#js-investment-report-alert').on 'click', ->
if this.checked && $('#budget_investment_feasibility_unfeasible').is(':checked')
confirm(this.dataset.alert + "\n" + this.dataset.notFeasibleAlert);
else if this.checked
confirm(this.dataset.alert);