Sha256: b82a6a19abe634d32ac880b1e32e02e8bb62c50132aaff0abf8825a14c56882f
Contents?: true
Size: 981 Bytes
Versions: 7
Compression:
Stored size: 981 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 = relative_url_root + '/admin/preview' form.submit() } finally { form.target = oldTarget form.action = oldAction } }) })
Version data entries
7 entries across 7 versions & 2 rubygems