mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 20:47:17 +02:00
@@ -259,12 +259,15 @@ define('forum/category/tools', [
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
app.loadJQueryUI(function () {
|
app.loadJQueryUI(function () {
|
||||||
$('[component="category"]').sortable({
|
var topicListEl = $('[component="category"]').filter(function (i, e) {
|
||||||
|
return !$(e).parents('[widget-area]').length;
|
||||||
|
});
|
||||||
|
topicListEl.sortable({
|
||||||
items: '[component="category/topic"].pinned',
|
items: '[component="category/topic"].pinned',
|
||||||
update: function () {
|
update: function () {
|
||||||
var data = [];
|
var data = [];
|
||||||
|
|
||||||
var pinnedTopics = $('[component="category/topic"].pinned');
|
var pinnedTopics = topicListEl.find('[component="category/topic"].pinned');
|
||||||
pinnedTopics.each(function (index, element) {
|
pinnedTopics.each(function (index, element) {
|
||||||
data.push({ tid: $(element).attr('data-tid'), order: pinnedTopics.length - index - 1 });
|
data.push({ tid: $(element).attr('data-tid'), order: pinnedTopics.length - index - 1 });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user