Permalink
Browse files

check if there is custom button added before inserting the default

'connect' button in the footer.
  • Loading branch information...
1 parent 7d8aa72 commit d33d72d27faea13901b873cf450927fc887cf092 @pyu10055 pyu10055 committed Dec 8, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/omniauth/form.rb
View
@@ -94,6 +94,7 @@ def initialize(options = {})
self.options = options
@html = ""
+ @with_custom_button = false
header(options[:title],options[:header_info])
end
@@ -130,6 +131,7 @@ def password_field(label, name)
end
def button(text)
+ @with_custom_button = true
@html << "\n<button type='submit'>#{text}</button>"
end
@@ -162,8 +164,8 @@ def header(title,header_info)
def footer
return self if @footer
+ @html << "\n<button type='submit'>Connect</button>" unless @with_custom_button
@html << <<-HTML
- <button type='submit'>Connect</button>
</form>
</body>
</html>

0 comments on commit d33d72d

Please sign in to comment.