Changeset 8879
- Timestamp:
- 02/16/08 00:07:52 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
r8294 r8879 193 193 options[:hoverclass] = "'#{options[:hoverclass]}'" if options[:hoverclass] 194 194 195 # Confirmation happens during the onDrop callback, so it can be removed from the options 196 options.delete(:confirm) if options[:confirm] 197 195 198 %(Droppables.add(#{element_id.to_json}, #{options_for_javascript(options)});) 196 199 end trunk/actionpack/test/template/scriptaculous_helper_test.rb
r8564 r8879 89 89 assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nDroppables.add(\"droptarget1\", {accept:['tshirts','mugs'], onDrop:function(element){new Ajax.Updater('infobox', 'http://www.example.com/', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}})\n//]]>\n</script>), 90 90 drop_receiving_element("droptarget1", :accept => ['tshirts','mugs'], :update => 'infobox') 91 assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nDroppables.add("droptarget1", {hoverclass:'dropready', onDrop:function(element){if (confirm('Are you sure?')) { new Ajax.Request('http://www.example.com/update_drop', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)}); }}})\n//]]>\n</script>), 92 drop_receiving_element('droptarget1', :hoverclass=>'dropready', :url=>{:action=>'update_drop'}, :confirm => 'Are you sure?') 93 91 94 end 92 93 95 def protect_against_forgery? 94 96 false