From 8829019101e2aba587a32f6c04cb2befc5de0f2b Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 26 Oct 2022 16:54:38 +0200 Subject: Add support for Material icon in files sidebar Signed-off-by: Carl Schwan Signed-off-by: Louis Chemineau --- apps/files/src/models/Tab.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps/files/src/models') 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 } -- cgit v1.2.3