mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°4667 - Remove call to tooltip function
This commit is contained in:
@@ -583,7 +583,7 @@ JS
|
||||
$oPage->add('<div id="select_dashlet" class="ibo-dashboard--available-dashlets--list" data-role="ibo-dashboard--available-dashlets--list">');
|
||||
$aAvailableDashlets = $this->GetAvailableDashlets();
|
||||
foreach ($aAvailableDashlets as $sDashletClass => $aInfo) {
|
||||
$oPage->add('<span dashlet_class="'.$sDashletClass.'" class="ibo-dashboard-editor--available-dashlet-icon dashlet_icon ui-widget-content ui-corner-all" data-role="ibo-dashboard-editor--available-dashlet-icon" id="dashlet_'.$sDashletClass.'" title="'.$aInfo['label'].'"><img src="'.$sUrl.$aInfo['icon'].'" /></span>');
|
||||
$oPage->add('<span dashlet_class="'.$sDashletClass.'" class="ibo-dashboard-editor--available-dashlet-icon dashlet_icon ui-widget-content ui-corner-all" data-role="ibo-dashboard-editor--available-dashlet-icon" id="dashlet_'.$sDashletClass.'" data-tooltip-content="'.$aInfo['label'].'" title="'.$aInfo['label'].'"><img src="'.$sUrl.$aInfo['icon'].'" /></span>');
|
||||
}
|
||||
$oPage->add('</div>');
|
||||
|
||||
|
||||
@@ -288,7 +288,8 @@ class ShortcutOQL extends Shortcut
|
||||
$oPage->add_ready_script(
|
||||
<<<JS
|
||||
// Note: the title gets deleted by the validation mechanism
|
||||
$("#attr_auto_reload_sec").tooltip({items: 'input', content: '$sRateTitle'});
|
||||
$("#attr_auto_reload_sec").attr('data-tooltip-content', '$sRateTitle');
|
||||
CombodoTooltip.InitTooltipFromMarkup($("#attr_auto_reload_sec"));
|
||||
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
|
||||
|
||||
$('#attr_auto_reload').change( function(ev) {
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
// For the same reason, tooltip widget is created in "drawCallback" instead of here.
|
||||
if( (data.tooltip !== undefined) && ($(data.tooltip).text() !== ''))
|
||||
{
|
||||
cellElem.html( $('<span></span>').attr('title', data.tooltip).attr('data-toggle', 'tooltip').html(data.name).prop('outerHTML') );
|
||||
cellElem.html( $('<span></span>').attr('data-tooltip-content', data.tooltip).attr('data-tooltip-html-enabled', true).html(data.name).prop('outerHTML') );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,9 +267,7 @@
|
||||
"columns": getColumnsDefinition(),
|
||||
"order": [],
|
||||
"drawCallback": function(settings){
|
||||
// Tooltip has to be created here, as the render callback only returns a string, not an object.
|
||||
$(this).find('[data-toggle="tooltip"]').tooltip({container: 'body', html: true, trigger: 'hover', placement: 'right'}); // container option is necessary when in a table
|
||||
// Hiding pagination if only one page
|
||||
// Hiding pagination if only one page
|
||||
if($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').hide();
|
||||
|
||||
@@ -217,7 +217,8 @@
|
||||
// Building tooltip for the node
|
||||
if( (item.tooltip !== undefined) && ($(item.tooltip).text() !== '') )
|
||||
{
|
||||
aElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'top'});
|
||||
aElem.attr('data-tooltip-content', item.tooltip).attr('data-tooltip-html-enabled', true);
|
||||
CombodoTooltip.InitTooltipFromMarkup(aElem);
|
||||
}
|
||||
|
||||
// Building actions for that node
|
||||
|
||||
@@ -206,7 +206,8 @@
|
||||
// Building tooltip for the node
|
||||
if( (item.tooltip !== undefined) && ($(item.tooltip).text() !== '') )
|
||||
{
|
||||
nameElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'right'});
|
||||
nameElem.attr('data-tooltip-content', item.tooltip).attr('data-tooltip-html-enabled', true);
|
||||
CombodoTooltip.InitTooltipFromMarkup(nameElem);
|
||||
}
|
||||
// Building description for the node
|
||||
if( (item.description !== undefined) && (item.description !== '') )
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
id="btn_export_excel_for_{{ aAreaData.sId }}"
|
||||
data-toggle="modal" data-target="#modal-for-all">
|
||||
<span class="fas fa-download fa-lg" style="float: right;"
|
||||
data-toggle="tooltip" data-delay="300" data-placement="left"
|
||||
title="{{ 'ExcelExporter:ExportMenu'|dict_s }}"></span>
|
||||
data-tooltip-html-enabled="true" data-tooltip-content="{{ 'ExcelExporter:ExportMenu'|dict_s }}"></span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -358,11 +357,6 @@
|
||||
});
|
||||
{% endfor %}
|
||||
|
||||
// Enable tooltips
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
});
|
||||
|
||||
// Auto collapse item actions popup
|
||||
$('body').on('click', function () {
|
||||
$('table .item-action-wrapper.collapse.in').collapse('hide');
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
class="tile tile_badge{# vertical-center#}"
|
||||
id="brick-{{ oBrick.GetId }}"
|
||||
data-brick-id="{{ oBrick.GetId }}"
|
||||
{% if oBrick.GetDescription is not empty %} data-toggle="tooltip" data-original-title="{{ oBrick.GetDescription|dict_s|raw }}"{% endif %}
|
||||
{% if oBrick.GetDescription is not empty %} data-tooltip-html-enabled="true" data-tooltip-content="{{ oBrick.GetDescription|dict_s|raw }}"{% endif %}
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
<h2>
|
||||
{% if form.title_clipboard_text is defined %}
|
||||
<i class="url-to-clipboard url-to-clipboard-icon fas fa-link fa-xs"
|
||||
data-clipboard-text="{{ form.title_clipboard_text }}"
|
||||
data-toggle="tooltip"
|
||||
title="{{ 'Brick:Portal:Object:Copy:Tooltip' | dict_s }}"
|
||||
data-clipboard-text="{{ form.title_clipboard_text }}"
|
||||
data-toggle="tooltip"
|
||||
data-tooltip-content="{{ 'Brick:Portal:Object:Copy:Tooltip' | dict_s }}"
|
||||
data-tooltip-html-enabled="true"
|
||||
data-copied-title="{{ 'Brick:Portal:Object:Copy:CopiedTooltip' | dict_s }}"
|
||||
data-copied-icon="fas fa-check">
|
||||
</i>
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
{% if form.title_clipboard_text is defined %}
|
||||
<i class="url-to-clipboard url-to-clipboard-icon fas fa-link fa-xs"
|
||||
data-clipboard-text="{{ form.title_clipboard_text }}"
|
||||
data-toggle="tooltip"
|
||||
title="{{ 'Brick:Portal:Object:Copy:Tooltip' | dict_s }}"
|
||||
data-toggle="tooltip"
|
||||
data-tooltip-content="{{ 'Brick:Portal:Object:Copy:Tooltip' | dict_s }}"
|
||||
data-tooltip-html-enabled="true"
|
||||
data-copied-title="{{ 'Brick:Portal:Object:Copy:CopiedTooltip' | dict_s }}"
|
||||
data-copied-icon="fas fa-check">
|
||||
</i>
|
||||
|
||||
@@ -159,11 +159,6 @@
|
||||
<script type="text/javascript" src="{{ js_file|add_itop_version }}"></script>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.tile.tile_badge[data-toggle="tooltip"]').tooltip({'html': true});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body class="{% block pPageBodyClass %}{% endblock %}" data-gui-type="portal">
|
||||
|
||||
@@ -34,7 +34,7 @@ $(function() {
|
||||
|
||||
_create: function () {
|
||||
var me = this;
|
||||
var sTitle = this.element.attr('title');
|
||||
var sTitle = this.element.attr('data-tooltip-content');
|
||||
var sDataTitleIcon = this.element.attr('data-title-icon');
|
||||
var sDataCopiedTitle = this.element.attr('data-copied-title');
|
||||
var sDataCopiedIcon = this.element.attr('data-copied-icon');
|
||||
@@ -57,14 +57,17 @@ $(function() {
|
||||
//initialize tooltip with mouse interaction
|
||||
this.element.on('click',function(){
|
||||
var sOriginalTitle = (me.options.copied_icon !== '' ? '<i class="'+me.options.copied_icon+' url-to-clipboard-tooltip-copied"></i>' : '') + me.options.copied_title;
|
||||
$(this).attr('data-original-title', sOriginalTitle).tooltip('show');
|
||||
$(this).attr('data-tooltip-content', sOriginalTitle);
|
||||
this._tippy.setContent(sOriginalTitle);
|
||||
this._tippy.show();
|
||||
//CombodoTooltip.InitTooltipFromMarkup($(this), true);
|
||||
});
|
||||
this.element.on('mouseout',function(){
|
||||
var sOriginalTitle = (me.options.standard_icon !== '' ? '<i class="'+me.options.standard_icon+' url-to-clipboard-tooltip-copied"></i>' : '') + me.options.standard_title;
|
||||
$(this).attr('data-original-title', sOriginalTitle);
|
||||
$(this).attr('data-tooltip-content', sOriginalTitle);
|
||||
CombodoTooltip.InitTooltipFromMarkup(me.element, true);
|
||||
$(this).removeClass('url-to-clipboard-copied');
|
||||
});
|
||||
this.element.tooltip({'html': true});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -236,21 +236,6 @@ function ReportFieldValidationStatus(sFieldId, sFormId, bValid, sExplain)
|
||||
{
|
||||
$('#v_'+sFieldId).html(sExplain);
|
||||
}
|
||||
//Avoid replacing exisiting tooltip for periodically checked element (like CKeditor fields)
|
||||
if($('#v_'+sFieldId).tooltip( "instance" ) === undefined)
|
||||
{
|
||||
// Visual feedback
|
||||
|
||||
$('#v_'+sFieldId).tooltip({
|
||||
items: 'span',
|
||||
classes: {
|
||||
"ui-tooltip": "form_field_error"
|
||||
},
|
||||
content: function() {
|
||||
return $(this).find('img').attr('data-tooltip'); // As opposed to the default 'content' handler, do not escape the contents of 'title'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -547,22 +547,18 @@ function ValidateWithPattern(sFieldId, bMandatory, sPattern, sFormId, aForbidden
|
||||
}
|
||||
if (sMessage)
|
||||
{
|
||||
$('#'+sFieldId).attr('title', sMessage).tooltip();
|
||||
if ($('#'+sFieldId).is(":focus"))
|
||||
{
|
||||
$('#'+sFieldId).tooltip('open');
|
||||
}
|
||||
$('#'+sFieldId).attr('data-tooltip-content', sMessage);
|
||||
CombodoTooltip.InitTooltipFromMarkup($('#'+sFieldId), true);
|
||||
$('#'+sFieldId)[0]._tippy.show();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#v_'+sFieldId).parent('.ibo-prop--apply').removeClass('ui-state-error');
|
||||
if ($('#'+sFieldId).data('uiTooltip'))
|
||||
{
|
||||
$('#'+sFieldId).tooltip('close');
|
||||
}
|
||||
$('#'+sFieldId).removeAttr('title');
|
||||
// Remove the element from the array
|
||||
$('#'+sFieldId).removeAttr('data-tooltip-instantiated');
|
||||
$('#'+sFieldId).removeAttr('data-tooltip-content');
|
||||
$('#'+sFieldId)[0]._tippy.destroy();
|
||||
// Remove the element from the array
|
||||
iFieldIdPos = jQuery.inArray(sFieldId, oFormValidation[sFormId]);
|
||||
if (iFieldIdPos > -1)
|
||||
{
|
||||
|
||||
@@ -263,13 +263,6 @@ JS
|
||||
\$oAttachmentTBody.append(sAttachmentRow);
|
||||
// Preview tooltip
|
||||
if(data.result.preview){
|
||||
$('#display_attachment_'+data.result.att_id +' a.trigger-preview').tooltip({
|
||||
container: 'body',
|
||||
html: true,
|
||||
title: function(){
|
||||
return '<div class="attachment-tooltip"><img src="'+sDownloadLink+'"></div>';
|
||||
}
|
||||
});
|
||||
}
|
||||
// Remove button handler
|
||||
$('#display_attachment_'+data.result.att_id+' :button').on('click', function(oEvent){
|
||||
@@ -310,14 +303,7 @@ JS
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Preview tooltip
|
||||
$('table#$sAttachmentTableId>tbody>tr>td a.trigger-preview').each(function(iIndex, oElem){
|
||||
$(oElem).parent().tooltip({
|
||||
container: 'body',
|
||||
html: true,
|
||||
title: function(){ return '<div class="attachment-tooltip"><img src="'+$(oElem).attr('href')+'"></div>'; }
|
||||
});
|
||||
});
|
||||
// Remove button handler
|
||||
$('.attachments_container table#$sAttachmentTableId>tbody>tr>td :button').on('click', function(oEvent){
|
||||
@@ -522,7 +508,7 @@ HTML;
|
||||
|
||||
return <<<HTML
|
||||
<tr id="display_attachment_{$iAttId}" class="attachment" $sLineStyle>
|
||||
<td role="icon"><a href="$sDocDownloadUrl" target="_blank" class="$sIconClass"><img $sIconClass src="$sAttachmentThumbUrl"></a></td>
|
||||
<td role="icon"><a href="$sDocDownloadUrl" target="_blank" class="$sIconClass" data-tooltip-content="<div class='attachment-tooltip'><img src='{$sDocDownloadUrl}'></div>" data-tooltip-html-enabled=true><img $sIconClass src="$sAttachmentThumbUrl" ></a></td>
|
||||
<td role="filename"><a href="$sDocDownloadUrl" target="_blank">$sFileName</a>$sAttachmentMeta</td>
|
||||
<td role="formatted-size" data-order="$iFileSizeRaw">$sFileSize</td>
|
||||
<td role="upload-date" data-order="$iAttachmentDateRaw">$sAttachmentDate</td>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{% apply spaceless %}
|
||||
<div class="ibo-dashlet-badge--body{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" id="{{ oUIBlock.GetId() }}"
|
||||
data-role="ibo-dashlet-badge--body"
|
||||
title="{{ oUIBlock.GetClassLabel() }}">
|
||||
data-tooltip-content="{{ oUIBlock.GetClassLabel() }}">
|
||||
<div class="ibo-dashlet-badge--icon-container">
|
||||
{# Mind the empty "alt" attribute https://www.w3.org/WAI/tutorials/images/decorative/ #}
|
||||
<img class="ibo-dashlet-badge--icon" src="{{ oUIBlock.GetClassIconUrl() }}" alt="">
|
||||
|
||||
Reference in New Issue
Block a user