mirror of
https://github.com/atom/atom.git
synced 2026-02-08 13:45:09 -05:00
move iframe creation into Browser
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
$ = require 'jquery'
|
||||
|
||||
module.exports =
|
||||
class Browser
|
||||
constructor: (@path) ->
|
||||
on: ->
|
||||
$('.main.pane').append @html().hide()
|
||||
on: ->
|
||||
html: ->
|
||||
$ "<iframe src='#{@path}' style='width:100%;height:100%'></iframe>"
|
||||
show: ->
|
||||
$(".main iframe[src='#{@path}']").show()
|
||||
hide: ->
|
||||
$(".main iframe[src='#{@path}']").hide()
|
||||
@@ -162,12 +162,7 @@ class Editor
|
||||
@ace.setSession buffer
|
||||
else
|
||||
$('#ace-editor').hide()
|
||||
path = buffer.path
|
||||
if $("iframe[src='#{path}']").length
|
||||
$("iframe[src='#{path}']").show()
|
||||
else
|
||||
$('#ace-editor').after iframe =
|
||||
"<iframe src='#{path}' style='width:100%;height:100%'></iframe>"
|
||||
buffer.show()
|
||||
|
||||
Storage.set @focusedPathKey, path
|
||||
Event.trigger "editor:bufferFocus", path
|
||||
|
||||
Reference in New Issue
Block a user