having composer/resize call findBootstrapEnvironment only on the first resize method call, and not right when library is required, #2417

v1.18.x
Julian Lam 10 years ago
parent 428a431164
commit 835886998b

@ -4,9 +4,9 @@
/* globals app, define, config, utils*/
define('composer/resize', function() {
var resize = {};
var env = utils.findBootstrapEnvironment();
var oldPercentage = 0;
var resize = {},
oldPercentage = 0,
env;
resize.reposition = function(postContainer) {
var percentage = localStorage.getItem('composer:resizePercentage');
@ -15,6 +15,10 @@ define('composer/resize', function() {
};
function doResize(postContainer, percentage) {
if (!env) {
env = utils.findBootstrapEnvironment();
}
if (percentage) {
if (env === 'md' || env === 'lg') {
postContainer.css('height', Math.floor($(window).height() * percentage) + 'px');

Loading…
Cancel
Save