diff options
author | Erik St. Martin <alakriti@gmail.com> | 2010-01-27 20:58:17 -0500 |
---|---|---|
committer | Erik St. Martin <alakriti@gmail.com> | 2010-01-27 20:58:17 -0500 |
commit | a0232d864177d14476bff73ac274a3ed820153f3 (patch) | |
tree | effb6b03b936e60728803e7445e54c1b45b645d9 /railties/lib/generators | |
parent | 4911343bf7719e76c8964445f9f146e7b8999b54 (diff) | |
download | rails-a0232d864177d14476bff73ac274a3ed820153f3.tar.gz rails-a0232d864177d14476bff73ac274a3ed820153f3.tar.bz2 rails-a0232d864177d14476bff73ac274a3ed820153f3.zip |
jquery driver now supports :confirm
Diffstat (limited to 'railties/lib/generators')
-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'); } }); |