add tooltip to order button
This commit is contained in:
parent
c25c4d84cc
commit
794e654114
1 changed files with 13 additions and 7 deletions
|
@ -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;
|
||||
}
|
Loading…
Reference in a new issue