public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
In javascript helpers option[:type] = :synchronous should work as described in 
docs.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
miloops (author)
Thu Jul 31 12:09:18 -0700 2008
NZKoz (committer)
Thu Jul 31 12:28:12 -0700 2008
commit  f3da46effae9f23f6ea473f7296e9c0c9bb49fce
tree    308a7248051c36a2ca39f3559f84c96c70e8f550
parent  cb68b21a52a12b0773f0b4dac1c9c673c93ba355
...
111
112
113
114
 
115
116
117
...
111
112
113
 
114
115
116
117
0
@@ -111,7 +111,7 @@ module ActionView
0
                          (100..599).to_a)
0
         AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
0
                          :asynchronous, :method, :insertion, :position,
0
-                         :form, :with, :update, :script ]).merge(CALLBACKS)
0
+                         :form, :with, :update, :script, :type ]).merge(CALLBACKS)
0
       end
0
 
0
       # Returns a link to a remote action defined by <tt>options[:url]</tt>
...
77
78
79
 
 
80
81
82
...
429
430
431
 
 
432
433
434
...
439
440
441
 
 
442
443
444
...
77
78
79
80
81
82
83
84
...
431
432
433
434
435
436
437
438
...
443
444
445
446
447
448
449
450
0
@@ -77,6 +77,8 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
0
       link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot"  })
0
     assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot?a=10&amp;b=20', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>),
0
       link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot", :a => '10', :b => '20' })
0
+    assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:false, evalScripts:true}); return false;\">Remote outauthor</a>),
0
+      link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :type => :synchronous)
0
   end
0
 
0
   def test_link_to_remote_html_options
0
@@ -429,6 +431,8 @@ Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
0
   def test_sortable
0
     assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
0
       @generator.sortable('blah', :url => { :action => "order" })
0
+    assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
0
+      @generator.sortable('blah', :url => { :action => "order" }, :type => :synchronous)
0
   end
0
 
0
   def test_draggable
0
@@ -439,6 +443,8 @@ Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
0
   def test_drop_receiving
0
     assert_equal %(Droppables.add("blah", {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});),
0
       @generator.drop_receiving('blah', :url => { :action => "order" })
0
+    assert_equal %(Droppables.add("blah", {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});),
0
+      @generator.drop_receiving('blah', :url => { :action => "order" }, :type => :synchronous)
0
   end
0
 
0
   def test_collection_first_and_last

Comments