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({
|
that = Ox.Button({
|
||||||
id: 'orderButton',
|
id: 'orderButton',
|
||||||
title: getTitle(),
|
title: getTitle(),
|
||||||
|
tooltip: getTooltip(),
|
||||||
// tooltip: 'Change sort order',
|
// tooltip: 'Change sort order',
|
||||||
type: 'image'
|
type: 'image'
|
||||||
})
|
})
|
||||||
|
@ -18,17 +19,22 @@ pandora.ui.orderButton = function(isNavigationView) {
|
||||||
key: pandora.user.ui[sortKey][0].key,
|
key: pandora.user.ui[sortKey][0].key,
|
||||||
operator: pandora.user.ui[sortKey][0].operator == '+' ? '-' : '+'
|
operator: pandora.user.ui[sortKey][0].operator == '+' ? '-' : '+'
|
||||||
}]);
|
}]);
|
||||||
that.options({title: getTitle()});
|
updateButton();
|
||||||
},
|
},
|
||||||
pandora_listsort: function() {
|
pandora_listsort: updateButton,
|
||||||
that.options({title: getTitle()});
|
pandora_itemsort: updateButton
|
||||||
},
|
|
||||||
pandora_itemsort: function() {
|
|
||||||
that.options({title: getTitle()});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
function getTitle() {
|
function getTitle() {
|
||||||
return pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down';
|
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;
|
return that;
|
||||||
}
|
}
|
Loading…
Reference in a new issue