forked from extern/egroupware
Add tooltip for Tab's header, it can be set as attribute 'hint' in openTab framework app object too
This commit is contained in:
parent
f88ae4f46a
commit
3956760c23
@ -492,7 +492,7 @@ var fw_base = (function(){ "use strict"; return Class.extend(
|
||||
_app.tab = this.tabsUi.addTab(_app.icon, this.tabClickCallback, this.tabCloseClickCallback,
|
||||
_app, _pos, _status);
|
||||
_app.tab.setTitle(_app.displayName);
|
||||
|
||||
_app.tab.setHint(_app.hint ? _app.hint : '');
|
||||
//Set the tab closeable if there's more than one tab
|
||||
this.tabsUi.setCloseable(this.tabsUi._isNotTheLastTab());
|
||||
// Do not show tab header if the app is with status 5, means run in background
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user