mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
having composer/resize call findBootstrapEnvironment only on the first resize method call, and not right when library is required, #2417
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user