mirror of
https://github.com/github/rails.git
synced 2026-02-04 19:25:10 -05:00
In javascript helpers option[:type] = :synchronous should work as described in docs.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
This commit is contained in:
committed by
Michael Koziarski
parent
cb68b21a52
commit
f3da46effa
@@ -111,7 +111,7 @@ module ActionView
|
||||
(100..599).to_a)
|
||||
AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
|
||||
:asynchronous, :method, :insertion, :position,
|
||||
:form, :with, :update, :script ]).merge(CALLBACKS)
|
||||
:form, :with, :update, :script, :type ]).merge(CALLBACKS)
|
||||
end
|
||||
|
||||
# Returns a link to a remote action defined by <tt>options[:url]</tt>
|
||||
|
||||
@@ -77,6 +77,8 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
||||
link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot" })
|
||||
assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot?a=10&b=20', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>),
|
||||
link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot", :a => '10', :b => '20' })
|
||||
assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:false, evalScripts:true}); return false;\">Remote outauthor</a>),
|
||||
link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :type => :synchronous)
|
||||
end
|
||||
|
||||
def test_link_to_remote_html_options
|
||||
@@ -429,6 +431,8 @@ Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
|
||||
def test_sortable
|
||||
assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
|
||||
@generator.sortable('blah', :url => { :action => "order" })
|
||||
assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
|
||||
@generator.sortable('blah', :url => { :action => "order" }, :type => :synchronous)
|
||||
end
|
||||
|
||||
def test_draggable
|
||||
@@ -439,6 +443,8 @@ Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
|
||||
def test_drop_receiving
|
||||
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)})}});),
|
||||
@generator.drop_receiving('blah', :url => { :action => "order" })
|
||||
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)})}});),
|
||||
@generator.drop_receiving('blah', :url => { :action => "order" }, :type => :synchronous)
|
||||
end
|
||||
|
||||
def test_collection_first_and_last
|
||||
|
||||
Reference in New Issue
Block a user