mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 22:59:57 +08:00
Add isEmpty function to ItemList (#1218)
* Add isEmpty function to ItemList * Fix coding style to be consistent. * Recompiled app.js for both js/admin/ and js/forum/
This commit is contained in:
@ -20,6 +20,22 @@ export default class ItemList {
|
||||
this.items = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the list is empty.
|
||||
*
|
||||
* @returns {boolean}
|
||||
* @public
|
||||
*/
|
||||
isEmpty() {
|
||||
for (const i in this.items) {
|
||||
if(this.items.hasOwnProperty(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether an item is present in the list.
|
||||
*
|
||||
|
Reference in New Issue
Block a user