Sha256: 042fde2669a8a60a019f7c7dd0c363313a9358436d5eb173ed5ff92dc16ab2a0

Contents?: true

Size: 1010 Bytes

Versions: 1

Compression:

Stored size: 1010 Bytes

Contents

// ==========================================================================
// Docs.DocFrameView
// ==========================================================================

require('core');

Docs.DocFrameView = SC.View.extend({
  
  // This is set to the test you want to run.
  doc: null,
  
  docObserver: function() {
    var doc = this.get('doc') ;
    var url = (doc) ? doc.get('url') : '' ;
    if (url.length > 0) {
      url = "/%@/%@/%@".fmt('sc_docs', Docs.docsController.get('clientName'), url) ;
    }
    
    // make sure we clear out the old document settings if needed.
    var fdoc = (this.rootElement.contentWindow) ? this.rootElement.contentWindow.document : this.rootElement.document ;
    
    // if the document URL is already loaded, then reload it...
    if (url == this.rootElement.src) {
      if (fdoc && fdoc.location) fdoc.location.reload() ;
      
    // otherwise set to the new URL.
    } else {
      this.rootElement.src = url ;
    }
    
  }.observes('doc')
    
}) ;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sproutcore-0.9.0 clients/sc_docs/views/doc_frame.js