diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-10-26 16:54:38 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2022-11-28 17:29:11 +0100 |
commit | 8829019101e2aba587a32f6c04cb2befc5de0f2b (patch) | |
tree | 0cc5dccc8a674a789dd2ea194d20b311d6a4f463 /apps/files/src/models | |
parent | 348796892b0cff6dfe38ce4d6761309552cc8c05 (diff) | |
download | nextcloud-server-8829019101e2aba587a32f6c04cb2befc5de0f2b.tar.gz nextcloud-server-8829019101e2aba587a32f6c04cb2befc5de0f2b.zip |
Add support for Material icon in files sidebar
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files/src/models')
-rw-r--r-- | apps/files/src/models/Tab.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files/src/models/Tab.js b/apps/files/src/models/Tab.js index 4c41ec5a3b1..9fd38f71bd7 100644 --- a/apps/files/src/models/Tab.js +++ b/apps/files/src/models/Tab.js @@ -59,8 +59,8 @@ export default class Tab { if (typeof name !== 'string' || name.trim() === '') { throw new Error('The name argument is not a valid string') } - if (typeof icon !== 'string' || icon.trim() === '') { - throw new Error('The icon argument is not a valid string') + if ((typeof icon !== 'string' || icon.trim() === '') && typeof icon !== 'object') { + throw new Error('The icon argument is not a valid string or vuejs component') } if (typeof mount !== 'function') { throw new Error('The mount argument should be a function') @@ -97,6 +97,10 @@ export default class Tab { return this._name } + get isIconClass() { + return typeof this._icon === 'string' + } + get icon() { return this._icon } |