Sha256: af77719ceda90e0d0c590e17553c247d221286308c3f58ffd639731d50570be0

Contents?: true

Size: 961 Bytes

Versions: 11

Compression:

Stored size: 961 Bytes

Contents

document.observe('dom:loaded', function() {
  
  var previewer = $('preview_panel')
  var preview_tools = previewer.down('.preview_tools')
  var frame = $('page-preview')
  var body = document.body
  
  Event.addBehavior({
   "div.preview_tools a.cancel:click" : function(event) {
      previewer.hide()
      body.removeClassName('clipped')
      frame.src = ''
      event.stop()
    },
    "iframe:load" : function(event) {
      preview_tools.style['opacity'] = null
    }
  });
  
  
  $('show-preview').observe('click', function(e) {
    e.stop();
    
    var form = this.form,
      oldTarget = form.target,
      oldAction = form.action
    
    try {
      $(body).scrollTo()
      previewer.show()
      preview_tools.style['opacity'] = 1
      body.addClassName('clipped')
      form.target = frame.id
      form.action = '/admin/preview'
      form.submit()
    } finally {
      form.target = oldTarget
      form.action = oldAction
    }
  })
})

Version data entries

11 entries across 10 versions & 2 rubygems

Version Path
radiant-1.1.0.beta public/javascripts/admin/page_preview.js
radiant-1.0.1 public/javascripts/admin/page_preview.js
radiant-1.1.0.alpha public/javascripts/admin/page_preview.js
radiant-1.0.0 public/javascripts/admin/page_preview.js
radiant-1.0.0.rc5 public/javascripts/admin/page_preview.js
radiant-1.0.0.rc4 public/javascripts/admin/page_preview.js
radiant-1.0.0.rc4 testthegemgeneration/public/javascripts/admin/page_preview.js
radiant-1.0.0.rc3 public/javascripts/admin/page_preview.js
kajam-1.0.3.rc2 public/javascripts/admin/page_preview.js
radiant-1.0.0.rc2 public/javascripts/admin/page_preview.js
radiant-1.0.0.rc1 public/javascripts/admin/page_preview.js