This commit is contained in:
Molkobain
2021-02-22 13:48:22 +01:00
parent c8ede0e8da
commit 083f50a5d4
4 changed files with 22 additions and 25 deletions

View File

@@ -639,16 +639,13 @@ JS
foreach( get_declared_classes() as $sDashletClass)
{
// DashletUnknown is not among the selection as it is just a fallback for dashlets that can't instanciated.
if ( is_subclass_of($sDashletClass, 'Dashlet') && !in_array($sDashletClass, array('DashletUnknown', 'DashletProxy')) )
{
// DashletUnknown is not among the selection as it is just a fallback for dashlets that can't instantiated.
if (is_subclass_of($sDashletClass, 'Dashlet') && !in_array($sDashletClass, array('DashletUnknown', 'DashletProxy'))) {
$oReflection = new ReflectionClass($sDashletClass);
if (!$oReflection->isAbstract())
{
if (!$oReflection->isAbstract()) {
$aCallSpec = array($sDashletClass, 'IsVisible');
$bVisible = call_user_func($aCallSpec);
if ($bVisible)
{
if ($bVisible) {
$aCallSpec = array($sDashletClass, 'GetInfo');
$aInfo = call_user_func($aCallSpec);
$aDashlets[$sDashletClass] = $aInfo;

View File

@@ -1113,7 +1113,7 @@ table .group-actions .item-action-wrapper .panel-body > p:last-child{
/*********/
/* Forms */
/*********/
.form_field_label > .control-label[data-tooltip-instanciated="true"] {
.form_field_label > .control-label[data-tooltip-instantiated="true"] {
&::after {
content: "?";
padding-left: 3px;

View File

@@ -109,17 +109,17 @@ CKEDITOR.plugins.add( 'disabler',
// Processing
$(document).ready(function(){
// Enable tooltips based on existing HTML markup, won't work on markup added dynamically after DOM ready (AJAX, ...)
$('[data-tooltip-content]:not([data-tooltip-instanciated="true"])').each(function(){
$('[data-tooltip-content]:not([data-tooltip-instantiated="true"])').each(function () {
CombodoTooltip.InitTooltipFromMarkup($(this));
});
// Enable fullscreen togglers based on existing HTML markup, won't work on markup added dynamically after DOM ready (AJAX, ...)
$('[data-fullscreen-toggler-target]:not([data-fullscreen-toggler-instanciated="true"])').each(function(){
$('[data-fullscreen-toggler-target]:not([data-fullscreen-toggler-instantiated="true"])').each(function () {
const sTargetSelector = $(this).attr('data-fullscreen-toggler-target');
let oTargetElem = null;
// Check if target selector is a jQuery expression, meaning that it needs to be evaluated (eg. $(this).closest('[data-role="ibo-xxx"]'))
if(sTargetSelector.indexOf('$') !== -1) {
if (sTargetSelector.indexOf('$') !== -1) {
oTargetElem = eval(sTargetSelector);
}
// Otherwise it should be a simple selector (eg. #abc, .def)
@@ -133,7 +133,7 @@ $(document).ready(function(){
}
// Toggle fullscreen on toggler click
$(this).on('click', function(oEvent){
$(this).on('click', function (oEvent) {
// Prevent anchor default behavior
oEvent.preventDefault();
@@ -141,19 +141,19 @@ $(document).ready(function(){
});
// Exit fullscreen on "Esc" key hit when focus is in either the toggler or the target
// - Toggler
$(this).on('keyup', function(oEvent){
if((oEvent.key === 'Escape') && ($(oEvent.target).attr('data-fullscreen-toggler-instanciated'))) {
$(this).on('keyup', function (oEvent) {
if ((oEvent.key === 'Escape') && ($(oEvent.target).attr('data-fullscreen-toggler-instantiated'))) {
CombodoBackofficeToolbox.ExitFullscreenForElement(oTargetElem);
}
});
// - Target
oTargetElem.on('keyup', function(oEvent){
if((oEvent.key === 'Escape') && ($(oEvent.target).attr('data-fullscreen-target'))) {
oTargetElem.on('keyup', function (oEvent) {
if ((oEvent.key === 'Escape') && ($(oEvent.target).attr('data-fullscreen-target'))) {
CombodoBackofficeToolbox.ExitFullscreenForElement(oTargetElem);
}
});
oTargetElem.attr('data-fullscreen-target', 'true');
$(this).attr('data-fullscreen-toggler-instanciated', 'true');
$(this).attr('data-fullscreen-toggler-instantiated', 'true');
});
});

View File

@@ -733,12 +733,12 @@ const CombodoGlobalToolbox = {};
*/
const CombodoTooltip = {
/**
* Instanciate a tooltip on oElem from its data attributes
* Instantiate a tooltip on oElem from its data attributes
*
* Note: Content SHOULD be HTML entity encoded to avoid markup breaks (eg. when using a double quote in a sentence)
*
* @param {Object} oElem The jQuery object representing the element
* @param {boolean} bForce When set to true, tooltip will be instanciate even if one already exists, overwritting it.
* @param {boolean} bForce When set to true, tooltip will be instantiate even if one already exists, overwritting it.
* @constructor
*/
InitTooltipFromMarkup: function (oElem, bForce = false) {
@@ -746,8 +746,8 @@ const CombodoTooltip = {
allowHTML: true, // Always true so line breaks can work. Don't worry content will be sanitized.
};
// First, check if the tooltip isn't already instanciated
if ((oElem.attr('data-tooltip-instanciated') === 'true') && (bForce === false)) {
// First, check if the tooltip isn't already instantiated
if ((oElem.attr('data-tooltip-instantiated') === 'true') && (bForce === false)) {
return false;
}
@@ -756,7 +756,7 @@ const CombodoTooltip = {
const bEnableHTML = oElem.attr('data-tooltip-html-enabled') === 'true';
// - Content should be sanitized unless the developer says otherwise
// Note: Condition is inversed on purpose. When the developer is instanciating a tooltip,
// Note: Condition is inversed on purpose. When the developer is instantiating a tooltip,
// we want him/her to explicitly declare that he/she wants the sanitizer to be skipped.
// Whereas in this code, it's easier to follow the logic with the variable oriented this way.
const bSanitizeContent = oElem.attr('data-tooltip-sanitizer-skipped') !== 'true';
@@ -796,8 +796,8 @@ const CombodoTooltip = {
tippy(oElem[0], oOptions);
// Mark tooltip as instanciated
oElem.attr('data-tooltip-instanciated', 'true');
// Mark tooltip as instantiated
oElem.attr('data-tooltip-instantiated', 'true');
},
/**
* Instantiate all tooltips that are not already.
@@ -812,7 +812,7 @@ const CombodoTooltip = {
oContainerElem = $('body');
}
oContainerElem.find('[data-tooltip-content]' + (bForce ? '' : ':not([data-tooltip-instanciated="true"])')).each(function () {
oContainerElem.find('[data-tooltip-content]' + (bForce ? '' : ':not([data-tooltip-instantiated="true"])')).each(function () {
CombodoTooltip.InitTooltipFromMarkup($(this), bForce);
});
}