diff options
Diffstat (limited to 'railties/lib/generators/rails/app/templates/public/javascripts')
-rw-r--r-- | railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js b/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js index 5189130c5c..52e35ec8bc 100644 --- a/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js +++ b/railties/lib/generators/rails/app/templates/public/javascripts/jquery.driver.js @@ -118,6 +118,18 @@ jQuery(function ($) { }); /** + * confirm + * make sure this event is first! + */ + $('a[data-confirm],input[data-confirm]').live('click', function(e){ + var el = $(this); + + if(!confirm(el.attr('data-confirm'))){ + return false; + } + }); + + /** * periodically_call_remote */ $('script[data-periodical="true"]').each(function (index, e) { @@ -155,10 +167,8 @@ jQuery(function ($) { if(el.attr('data-popup') === "true"){ window.open(url); - console.log('without options'); } else { window.open(url, el.attr('data-popup')); - console.log('with options'); } }); |