Changed iframe resize function

Instead of resizing the iframe based on the height of the body element
of the iframe content, do it based on the entire content height. Also,
don't compare the inner content height to the body height of the outer
page, but use the iframe height instead.
This commit is contained in:
Alex Sanford 2012-04-10 21:29:54 -03:00
parent e2b73d786a
commit 56a0affbcb

View File

@ -30,11 +30,11 @@ class Locomotive.Views.InlinEditor.ApplicationView extends Backbone.View
if @_$('meta[name=inline-editor]').size() > 0
# bind the resize event. When the iFrame's size changes, update its height
iframe_content = iframe.contents().find('body')
iframe_content = iframe.contents()
iframe_content.resize ->
elem = $(this)
if elem.outerHeight(true) > $('body').outerHeight(true) # Resize the iFrame.
if elem.outerHeight(true) > iframe.outerHeight(true) # Resize the iFrame.
iframe.css height: elem.outerHeight(true)
# Resize the iFrame immediately.