button_to_function is deprecated

This commit is contained in:
joshua stein 2012-09-19 12:37:42 -05:00
parent 0663ea0fed
commit d9bd724c1d
2 changed files with 15 additions and 2 deletions

View file

@ -642,6 +642,10 @@ div#story_preview {
div#story_box input#story_url {
width: 508px;
}
div#story_box button#story_fetch_title {
padding-top: 1px;
padding-bottom: 1px;
}
div#story_box input#story_title,
div#story_box input#story_moderation_reason {
width: 600px;

View file

@ -10,8 +10,8 @@
<% elsif !f.object.id %>
<%= f.label :url, "URL:", :class => "required" %>
<%= f.text_field :url, :autocomplete => "off" %>
<%= button_to_function "Fetch Title",
"Lobsters.fetchURLTitle($(this), $('#story_url'), $('#story_title'));" %>
<%= button_tag "Fetch Title", :id => "story_fetch_title",
:type => "button" %>
<% end %>
</div>
@ -40,3 +40,12 @@
:autocomplete => "off" %>
</div>
</div>
<script>
$(document).ready(function() {
$("#story_fetch_title").click(function() {
Lobsters.fetchURLTitle($(this), $("#story_url"), $("#story_title"));
return false;
});
});
</script>