Move tooltips JS helpers to dedicated class "CombodoGlobalToolbox => CombodoTooltip"

This commit is contained in:
Molkobain
2021-02-20 15:27:32 +01:00
parent 5bde218076
commit 9bbec47976
7 changed files with 47 additions and 45 deletions

View File

@@ -502,30 +502,32 @@
{
ShowErrorDialog();
}
}
else
} else
{
ShowErrorDialog();
}
});
});
// Enable tooltips based on existing HTML markup, won't work on markup added dynamically after DOM ready (AJAX, ...) ...
CombodoGlobalToolbox.InitAllNonInstantiatedTooltips();
// ... except for object form which are handled with the following ...
$('body').on('form_built', function(oEvent){
CombodoGlobalToolbox.InitAllNonInstantiatedTooltips($(oEvent.target));
});
// ... and BS modals which are handle with the following
$('body').on('loaded.bs.modal', function (oEvent){
// Little timeout for stuff that need a moment to get ready but don't have a proper event.
setTimeout(function(){
//CombodoGlobalToolbox.InitAllNonInstantiatedTooltips($(oEvent.target));
}, 500);
});
// Initialize confirmation message handler when a form with touched fields is closed
$('body').portal_leave_handler({'message': '{{ 'Portal:Form:Close:Warning'|dict_s }}'});
{% endblock %}
// Enable tooltips based on existing HTML markup, won't work on markup added dynamically after DOM ready (AJAX, ...) ...
CombodoTooltip.InitAllNonInstantiatedTooltips();
// ... except for object form which are handled with the following ...
$('body').on('form_built', function (oEvent)
{
CombodoTooltip.InitAllNonInstantiatedTooltips($(oEvent.target));
});
// ... and BS modals which are handle with the following
$('body').on('loaded.bs.modal', function (oEvent)
{
// Little timeout for stuff that need a moment to get ready but don't have a proper event.
setTimeout(function ()
{
//CombodoTooltip.InitAllNonInstantiatedTooltips($(oEvent.target));
}, 500);
});
// Initialize confirmation message handler when a form with touched fields is closed
$('body').portal_leave_handler({'message': '{{ 'Portal:Form:Close:Warning'|dict_s }}'});
{% endblock %}
});
</script>
{% endblock %}