mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 18:18:46 +02:00
N°3833 Fix DashletBadge in Ajax causing JS error
* switch dashlet_badge widget init from js_template to js_on_ready_template * add phpdoc on UIBlock::DEFAULT_JS_FILES_REL_PATH * remove old code in \AjaxPage::output (after the return statement) that is already handled with the new Twig rendering
This commit is contained in:
@@ -16,7 +16,7 @@ class DashletBadge extends DashletContainer
|
||||
|
||||
public const BLOCK_CODE = 'ibo-dashlet-badge';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/dashlet/dashlet-badge';
|
||||
public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/dashlet/dashlet-badge';
|
||||
public const DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH = 'base/components/dashlet/dashlet-badge';
|
||||
public const DEFAULT_JS_FILES_REL_PATH = [
|
||||
'js/components/dashlet/dashlet-badge.js',
|
||||
];
|
||||
|
||||
@@ -43,7 +43,11 @@ abstract class UIBlock implements iUIBlock
|
||||
public const DEFAULT_GLOBAL_TEMPLATE_REL_PATH = null;
|
||||
/** @var string|null */
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = null;
|
||||
/** @var array */
|
||||
/**
|
||||
* @var array list of external JS file paths to include in the page. Paths are relative to APPROOT
|
||||
* **Warning** : if you need to call a JS var defined in one of this file, then this calling code MUST be in {@see DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH}
|
||||
* and not in {@see DEFAULT_JS_TEMPLATE_REL_PATH} ! Indeed the later is output before external files loading.
|
||||
*/
|
||||
public const DEFAULT_JS_FILES_REL_PATH = [];
|
||||
/** @var string|null */
|
||||
public const DEFAULT_JS_TEMPLATE_REL_PATH = null;
|
||||
|
||||
Reference in New Issue
Block a user