From a3c05b2ea4b403077b6b97adbaf0831eb44c175f Mon Sep 17 00:00:00 2001 From: pichalite Date: Mon, 16 Jan 2017 23:40:25 +0000 Subject: [PATCH 1/5] Send isMain to post.save filters --- src/posts/create.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/posts/create.js b/src/posts/create.js index 2b626bd52b..c6b232cf28 100644 --- a/src/posts/create.js +++ b/src/posts/create.js @@ -19,6 +19,7 @@ module.exports = function (Posts) { var tid = data.tid; var content = data.content.toString(); var timestamp = data.timestamp || Date.now(); + var isMain = data.isMain || false; if (!uid && parseInt(uid, 10) !== 0) { return callback(new Error('[[error:invalid-uid]]')); @@ -42,7 +43,8 @@ module.exports = function (Posts) { 'tid': tid, 'content': content, 'timestamp': timestamp, - 'deleted': 0 + 'deleted': 0, + 'isMain': isMain }; if (data.toPid) { From 9176f7e0376a365d9bc6598329ea5dea935346b1 Mon Sep 17 00:00:00 2001 From: pichalite Date: Tue, 17 Jan 2017 18:24:16 +0000 Subject: [PATCH 2/5] Only send isMain to hook instead of saving to post hash --- src/posts/create.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/posts/create.js b/src/posts/create.js index c6b232cf28..3484bc424e 100644 --- a/src/posts/create.js +++ b/src/posts/create.js @@ -43,8 +43,7 @@ module.exports = function (Posts) { 'tid': tid, 'content': content, 'timestamp': timestamp, - 'deleted': 0, - 'isMain': isMain + 'deleted': 0 }; if (data.toPid) { @@ -108,6 +107,7 @@ module.exports = function (Posts) { }); }, function (postData, next) { + postData.isMain = isMain; plugins.fireHook('action:post.save', _.clone(postData)); next(null, postData); } From 08af9248739409b0082113675adb02d65a02264f Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 17 Jan 2017 14:05:19 -0500 Subject: [PATCH 3/5] closes #5189 --- public/src/client/infinitescroll.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/client/infinitescroll.js b/public/src/client/infinitescroll.js index 6ae9b5cbbc..ed43e4da22 100644 --- a/public/src/client/infinitescroll.js +++ b/public/src/client/infinitescroll.js @@ -23,7 +23,9 @@ define('forum/infinitescroll', function () { }; function onScroll() { - if (loadingMore) { + var bsEnv = utils.findBootstrapEnvironment(); + var mobileComposerOpen = (bsEnv === 'xs' || bsEnv === 'sm') && $('html').hasClass('composing'); + if (loadingMore || mobileComposerOpen) { return; } var currentScrollTop = $(window).scrollTop(); From 7b234c666f7b1810e6de5a6ec4ee03436222c2f7 Mon Sep 17 00:00:00 2001 From: pichalite Date: Wed, 18 Jan 2017 20:32:19 +0000 Subject: [PATCH 4/5] Fixes #5344 --- public/src/admin/manage/category.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js index 351c7a624b..cb0eb22a35 100644 --- a/public/src/admin/manage/category.js +++ b/public/src/admin/manage/category.js @@ -73,7 +73,7 @@ define('admin/manage/category', [ } - $('form.category input, form.category select') + $('form.category input, form.category select').not($('.privilege-table-container input')) .on('change', function (ev) { modified(ev.target); }) From 97fe86c91685dae39786a09796a24f7c90645c9a Mon Sep 17 00:00:00 2001 From: Peter Jaszkowiak Date: Thu, 19 Jan 2017 12:13:23 -0700 Subject: [PATCH 5/5] Fix wrapper breaking when no attrs need replaced --- public/vendor/bootbox/wrapper.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/public/vendor/bootbox/wrapper.js b/public/vendor/bootbox/wrapper.js index 429fa9d6c6..505b42788f 100644 --- a/public/vendor/bootbox/wrapper.js +++ b/public/vendor/bootbox/wrapper.js @@ -52,12 +52,16 @@ require(['translator'], function (shim) { ]).then(function (ref) { var translated = ref[0]; var translatedAttrs = ref[1]; - translated.split(' || ').forEach(function (html, i) { - $(nodes[i]).replaceWith(html); - }); - translatedAttrs.split(' || ').forEach(function (text, i) { - attrNodes[i][1].setAttribute(attrNodes[i][0], text); - }); + if (translated) { + translated.split(' || ').forEach(function (html, i) { + $(nodes[i]).replaceWith(html); + }); + } + if (translatedAttrs) { + translatedAttrs.split(' || ').forEach(function (text, i) { + attrNodes[i][1].setAttribute(attrNodes[i][0], text); + }); + } if (show) { $elem.modal('show'); }