simplify browser. now we can have more than one in a project.

This commit is contained in:
Chris Wanstrath
2011-11-13 00:21:10 -08:00
parent 5fd7d797e4
commit 6cb4e6dff9

View File

@@ -8,17 +8,14 @@ class Browser extends Resource
url: null
html: $ "<div id='browser'></div>"
iframe: ->
$ "<iframe src='#{@url}' style='width:100%;height:100%'></iframe>"
open: (url) ->
return false if not /^https?:/.test url
@url = url
@html.html @iframe().bind 'load', (e) =>
window.setTitle e.target.contentWindow.document.title
@html = """
<iframe src='#{@url}' style='width:100%;height:100%'></iframe>
"""
@show()