check if there is custom button added before inserting the default

'connect' button in the footer.
This commit is contained in:
Ping Yu 2011-12-08 09:54:20 -06:00
parent 7d8aa725a1
commit d33d72d27f
1 changed files with 3 additions and 1 deletions

View File

@ -94,6 +94,7 @@ module OmniAuth
self.options = options
@html = ""
@with_custom_button = false
header(options[:title],options[:header_info])
end
@ -130,6 +131,7 @@ module OmniAuth
end
def button(text)
@with_custom_button = true
@html << "\n<button type='submit'>#{text}</button>"
end
@ -162,8 +164,8 @@ module OmniAuth
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>