forked from ibm-js/deliteful
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TooltipDialog.js
59 lines (52 loc) · 1.6 KB
/
TooltipDialog.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/** @module deliteful/TooltipDialog */
define([
"delite/register",
"delite/Dialog",
"./Tooltip",
"delite/handlebars!./TooltipDialog/TooltipDialog.html",
"delite/theme!./TooltipDialog/themes/{{theme}}/TooltipDialog.css",
"delite/uacss" // TooltipDialog.less uses d-ie class
], function (register, Dialog, Tooltip, template) {
/**
* A tooltip dialog widget, to be used as a popup.
* Meant to contain forms or interactive controls (ex: links, buttons).
*
* @class module:deliteful/TooltipDialog
* @augments module:delite/Dialog
* @augments module:deliteful/Tooltip
*/
return register("d-tooltip-dialog", [Tooltip, Dialog], /** @lends module:deliteful/TooltipDialog# */ {
/**
* The name of the CSS class of this widget.
* @member {string}
* @default "d-tooltip"
*/
baseClass: "d-tooltip d-tooltip-dialog",
template: template,
/**
* The title of the TooltipDialog, displayed at the top, above the content.
* @member {string}
*/
label: "",
/**
* Class to display the close button icon.
* @member {string}
* @default "d-tooltip-dialog-close-icon"
*/
closeButtonIconClass: "d-tooltip-dialog-close-icon",
focus: function () {
// Focus on first field.
this._getFocusItems();
if (this._firstFocusItem && this._firstFocusItem !== this) {
this._firstFocusItem.focus();
}
},
closeButtonClickHandler: function () {
this.emit("cancel");
},
// Override Toolip#onOpen() and onClose() to *not* set aria-describedby,
// because it shouldn't be set for TooltipDialog, but only for Tooltip
onOpen: function () {},
onClose: function () {}
});
});