aliases
This commit is contained in:
@@ -48,10 +48,18 @@ class LoaderParamsProvider
|
||||
|
||||
foreach ($this->metadata->get(['app', 'jsLibs'], []) as $key => $item) {
|
||||
$id = $item['amdId'] ?? null;
|
||||
/** @var ?string[] $aliases */
|
||||
$aliases = $item['aliases'] ?? null;
|
||||
|
||||
if ($id) {
|
||||
$map->$id = 'lib!' . $key;
|
||||
}
|
||||
|
||||
if ($aliases) {
|
||||
foreach ($aliases as $alias) {
|
||||
$map->$alias = 'lib!' . $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $map;
|
||||
|
||||
@@ -115,7 +115,8 @@
|
||||
"path": "client/lib/bootstrap-colorpicker.js",
|
||||
"exportsTo": "$.fn",
|
||||
"exportsAs": "colorpicker",
|
||||
"amdId": "bootstrap-colorpicker"
|
||||
"amdId": "bootstrap-colorpicker",
|
||||
"aliases": ["lib!Colorpicker"]
|
||||
},
|
||||
"exif-js": {
|
||||
"path": "client/lib/exif.js",
|
||||
|
||||
@@ -39,7 +39,7 @@ class ColorpickerFieldView extends VarcharFieldView {
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
this.wait(Espo.loader.requirePromise('lib!Colorpicker'));
|
||||
this.wait(Espo.loader.requirePromise('lib!bootstrap-colorpicker'));
|
||||
}
|
||||
|
||||
afterRender() {
|
||||
|
||||
@@ -48,6 +48,13 @@
|
||||
"amdId": {
|
||||
"type": "string",
|
||||
"description": "An AMD ID. Needs to be specified if the module uses a named define function or other 3rd party modules require that ID."
|
||||
},
|
||||
"aliases": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Module IDs the lib will be available by. Can be useful for backward compatibility."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user