mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +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*/
|
/* globals app, define, config, utils*/
|
||||||
|
|
||||||
define('composer/resize', function() {
|
define('composer/resize', function() {
|
||||||
var resize = {};
|
var resize = {},
|
||||||
var env = utils.findBootstrapEnvironment();
|
oldPercentage = 0,
|
||||||
var oldPercentage = 0;
|
env;
|
||||||
|
|
||||||
resize.reposition = function(postContainer) {
|
resize.reposition = function(postContainer) {
|
||||||
var percentage = localStorage.getItem('composer:resizePercentage');
|
var percentage = localStorage.getItem('composer:resizePercentage');
|
||||||
@@ -15,6 +15,10 @@ define('composer/resize', function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function doResize(postContainer, percentage) {
|
function doResize(postContainer, percentage) {
|
||||||
|
if (!env) {
|
||||||
|
env = utils.findBootstrapEnvironment();
|
||||||
|
}
|
||||||
|
|
||||||
if (percentage) {
|
if (percentage) {
|
||||||
if (env === 'md' || env === 'lg') {
|
if (env === 'md' || env === 'lg') {
|
||||||
postContainer.css('height', Math.floor($(window).height() * percentage) + 'px');
|
postContainer.css('height', Math.floor($(window).height() * percentage) + 'px');
|
||||||
|
|||||||
Reference in New Issue
Block a user