Node.js based forum software built for the modern web
moved findBootstrapEnvironment into utils
psychobunny882589acaee7
diff --git a/public/src/modules/composer.js b/public/src/modules/composer.jsindex bd97c20b29..a6c6b0f830 100644--- a/public/src/modules/composer.js+++ b/public/src/modules/composer.js@@ -156,24 +156,6 @@ define(['taskbar'], function(taskbar) {composer.load(uuid);}- //http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api- function findBootstrapEnvironment() {- var envs = ['xs', 'sm', 'md', 'lg'],- $el = $('<div>');-- $el.appendTo($('body'));-- for (var i = envs.length - 1; i >= 0; i--) {- var env = envs[i];-- $el.addClass('hidden-'+env);- if ($el.is(':hidden')) {- $el.remove();- return env;- }- }- }-function composerAlert(message) {$('.action-bar button').removeAttr('disabled');app.alert({@@ -186,7 +168,6 @@ define(['taskbar'], function(taskbar) {}function initializeDragAndDrop(post_uuid) {-if($.event.props.indexOf('dataTransfer') === -1) {$.event.props.push('dataTransfer');}@@ -852,7 +833,6 @@ define(['taskbar'], function(taskbar) {};composer.activateReposition = function(post_uuid) {-if(composer.active && composer.active !== post_uuid) {composer.minimize(composer.active);}@@ -861,7 +841,7 @@ define(['taskbar'], function(taskbar) {postContainer = $('#cmp-uuid-' + post_uuid);composer.active = post_uuid;- var env = findBootstrapEnvironment();+ var env = utils.findBootstrapEnvironment();if (percentage) {if ( env === 'md' || env === 'lg') {diff --git a/public/src/utils.js b/public/src/utils.jsindex 528f5b9981..534ef59273 100644--- a/public/src/utils.js+++ b/public/src/utils.js@@ -254,6 +254,24 @@// http://stackoverflow.com/questions/9286355/how-to-detect-only-the-native-android-browservar nua = navigator.userAgent;return ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1));+ },++ findBootstrapEnvironment: function() {+ //http://stackoverflow.com/questions/14441456/how-to-detect-which-device-view-youre-on-using-twitter-bootstrap-api+ var envs = ['xs', 'sm', 'md', 'lg'],+ $el = $('<div>');++ $el.appendTo($('body'));++ for (var i = envs.length - 1; i >= 0; i--) {+ var env = envs[i];++ $el.addClass('hidden-'+env);+ if ($el.is(':hidden')) {+ $el.remove();+ return env;+ }+ }}};