mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
simplify browser. now we can have more than one in a project.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user