Add tooltip for Tab's header, it can be set as attribute 'hint' in openTab framework app object too

This commit is contained in:
Hadi Nategh
2020-09-25 11:53:00 +02:00
parent f88ae4f46a
commit 3956760c23
2 changed files with 13 additions and 1 deletions

View File

@ -308,6 +308,7 @@ function egw_fw_ui_tab(_parent, _contHeaderDiv, _contDiv, _icon, _callback,
this.position = _pos;
this.status = _status;
this.notification = 0;
this.hint = '';
//Create the header div and set its "click" function and "hover" event
this.headerDiv = document.createElement("span");
@ -439,6 +440,17 @@ egw_fw_ui_tab.prototype.setTitle = function(_title)
jQuery(this.headerH1).text(_title);
};
/**
* setHint sets tooltip of this tab. An existing tooltip will be removed.
*
* @param {string} _hint Text which should be displayed.
*/
egw_fw_ui_tab.prototype.setHint = function(_hint)
{
this.hint = _hint;
egw().tooltipBind(jQuery(this.headerDiv), _hint);
};
/**
* setTitle sets the content of this tab. Existing content is removed.
*