Skip to content

Instantly share code, notes, and snippets.

@subelsky
Created August 20, 2008 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subelsky/6421 to your computer and use it in GitHub Desktop.
Save subelsky/6421 to your computer and use it in GitHub Desktop.
require('core')
App.IframeView = SC.View.extend({
emptyElement: '<iframe></iframe>',
content: '',
noIframeText: '',
frameBorder: 0,
render: function() {
var content = this.get('content')
var srcKey = this.getDelegateProperty(this.displayDelegate, 'contentValueKey')
var src = (srcKey && content && content.get) ? content.get(srcKey) : null
this.set('src',src)
this.set('frameborder',this.get('frameBorder'))
this.set('innerHTML',this.get('noIframeText'))
}.observes('content')
})
// trying to invoke via
// <%= view 'message_iframe', :view => 'App.IframeView', :tag => 'iframe', :content_value_key => 'body_url', :width => 730,
// :height => 500, :bind => { :content => 'App.messageDetailController.content' } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment