From 694e8859ea6292519cec8f4cc50ac32f4fd043a0 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 28 Aug 2024 14:51:54 +0200 Subject: [PATCH] allow arbitrary subdirectories in image-name --- api/js/jsapi/egw_images.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/js/jsapi/egw_images.js b/api/js/jsapi/egw_images.js index b95146a71b..591389341d 100644 --- a/api/js/jsapi/egw_images.js +++ b/api/js/jsapi/egw_images.js @@ -78,12 +78,12 @@ egw.extend('images', egw.MODULE_GLOBAL, function() // Handle images in appname/imagename format if(_name.indexOf('/') > 0) { - var split = _name.split('/',2); - // dhtmlxtree and egw_action are subdirs in image dir, not applications - if (split[0] !== 'dhtmlxtree' && split[0] !== 'egw_action') + var split = _name.match(/^([^/]+)\/(.*)$/); + // e.g. dhtmlxtree and egw_action are subdirs in image dir, not applications + if (typeof images[split[1]] !== 'undefined') { - _app = split[0]; - _name = split[1]; + _app = split[1]; + _name = split[2]; } }