forked from 0x2620/oxjs
Create tooltip only on mouseenter
This commit is contained in:
parent
37d9424ec8
commit
120a9eda41
3 changed files with 39 additions and 14 deletions
|
|
@ -48,9 +48,12 @@ Ox.Button = function(options, self) {
|
|||
}) : options || {})
|
||||
.update({
|
||||
disabled: setDisabled,
|
||||
//FIXME: check if this is still needed
|
||||
tooltip: function() {
|
||||
that.$tooltip.options({title: self.options.disabled});
|
||||
if (Ox.isArray(self.options.tooltip) && that.$tooltip) {
|
||||
that.$tooltip.options({
|
||||
title: self.options.tooltip[self.value]
|
||||
});
|
||||
}
|
||||
},
|
||||
title: setTitle,
|
||||
value: function() {
|
||||
|
|
@ -106,6 +109,11 @@ Ox.Button = function(options, self) {
|
|||
|
||||
if (Ox.isArray(options.tooltip)) {
|
||||
self.options.tooltip = options.tooltip;
|
||||
// Ox.Element creates tooltip only on mouse over.
|
||||
// create here to overwrite tooltip title
|
||||
if (!that.$tooltip) {
|
||||
that.$tooltip = Ox.Tooltip();
|
||||
}
|
||||
that.$tooltip.options({
|
||||
title: self.options.tooltip[self.value]
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue