1
0
Fork 0
forked from 0x2620/oxjs

Create tooltip only on mouseenter

This commit is contained in:
j 2014-02-02 11:05:41 +00:00 committed by rolux
commit 120a9eda41
3 changed files with 39 additions and 14 deletions

View file

@ -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]
});