add tooltip to order button

This commit is contained in:
rolux 2011-11-06 00:05:09 +00:00
parent c25c4d84cc
commit 794e654114

View file

@ -5,6 +5,7 @@ pandora.ui.orderButton = function(isNavigationView) {
that = Ox.Button({
id: 'orderButton',
title: getTitle(),
tooltip: getTooltip(),
// tooltip: 'Change sort order',
type: 'image'
})
@ -18,17 +19,22 @@ pandora.ui.orderButton = function(isNavigationView) {
key: pandora.user.ui[sortKey][0].key,
operator: pandora.user.ui[sortKey][0].operator == '+' ? '-' : '+'
}]);
that.options({title: getTitle()});
updateButton();
},
pandora_listsort: function() {
that.options({title: getTitle()});
},
pandora_itemsort: function() {
that.options({title: getTitle()});
}
pandora_listsort: updateButton,
pandora_itemsort: updateButton
});
function getTitle() {
return pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down';
}
function getTooltip() {
return pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending';
}
function updateButton() {
that.options({
title: getTitle(),
tooltip: getTooltip()
});
}
return that;
}