mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 23:29:57 +08:00
Split discussion controls into three groups:
- user (reply, subscription) - moderation (rename, sticky, tags) - destructive (delete) Will keep extension-added items organised nicely
This commit is contained in:
@ -59,7 +59,18 @@ export default class ItemList {
|
||||
}
|
||||
});
|
||||
|
||||
return array.map((item) => item.content);
|
||||
array = array.map(item => item.content);
|
||||
|
||||
//recursively flatten array
|
||||
for (var i = 0, len = array.length; i < len; i++) {
|
||||
if (array[i] instanceof Array) {
|
||||
array = array.concat.apply([], array);
|
||||
i-- //check current index again and flatten until there are no more nested arrays at that index
|
||||
len = array.length;
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user