From 56a0affbcb7c34319ad0ff48b94ff77db2660bbf Mon Sep 17 00:00:00 2001 From: Alex Sanford Date: Tue, 10 Apr 2012 21:29:54 -0300 Subject: [PATCH 1/2] 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. --- .../locomotive/views/inline_editor/application_view.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee b/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee index 9ed71b53..2f242986 100644 --- a/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee +++ b/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee @@ -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. From edca6323fb03980ffaf857204dd1af661cc1a7b0 Mon Sep 17 00:00:00 2001 From: Mario Visic Date: Fri, 13 Apr 2012 22:11:44 +0800 Subject: [PATCH 2/2] Fixed a regression when updating javascript stringify. Fixes #355. --- app/assets/javascripts/locomotive/utils/core_ext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/locomotive/utils/core_ext.js b/app/assets/javascripts/locomotive/utils/core_ext.js index c3e112cd..61d3501c 100644 --- a/app/assets/javascripts/locomotive/utils/core_ext.js +++ b/app/assets/javascripts/locomotive/utils/core_ext.js @@ -18,7 +18,7 @@ String.prototype.slugify = function(sep) { if (typeof sep == 'undefined') sep = '_'; - var alphaNumRegexp = new RegExp('[^\w\\' + sep + ']', 'g'); + var alphaNumRegexp = new RegExp('[^\\w\\' + sep + ']', 'g'); var avoidDuplicateRegexp = new RegExp('[\\' + sep + ']{2,}', 'g'); return this.replace(/\s/g, sep).replace(alphaNumRegexp, '').replace(avoidDuplicateRegexp, sep).toLowerCase() }