From dc035c11f3da18421640569940589323a8c14b9f Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 10 Nov 2015 14:40:11 -0500 Subject: [PATCH] updated widget code to work better with sidebar areas --- package.json | 2 +- public/src/widgets.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f630c487a4..e3d766a9bb 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "nodebb-plugin-spam-be-gone": "0.4.2", "nodebb-rewards-essentials": "0.0.6", "nodebb-theme-lavender": "3.0.0", - "nodebb-theme-persona": "4.0.35", + "nodebb-theme-persona": "4.0.36", "nodebb-theme-vanilla": "5.0.13", "nodebb-widget-essentials": "2.0.5", "nodemailer": "0.7.1", diff --git a/public/src/widgets.js b/public/src/widgets.js index 18d593ad1f..2a8b052bba 100644 --- a/public/src/widgets.js +++ b/public/src/widgets.js @@ -57,7 +57,13 @@ if (location === 'footer' && !$('#content [widget-area="footer"]').length) { $('#content').append($('
')); } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) { - $('#content > *').wrapAll($('
')); + if ($('[component="account/cover"]').length) { + $('[component="account/cover"]').nextAll().wrapAll($('
')); + } else if ($('[component="groups/cover"]').length) { + $('[component="groups/cover"]').nextAll().wrapAll($('
')); + } else { + $('#content > *').wrapAll($('
')); + } } else if (location === 'header' && !$('#content [widget-area="header"]').length) { $('#content').prepend($('
')); }