2011-07-29 18:37:11 +00:00
|
|
|
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
2011-11-05 17:04:10 +00:00
|
|
|
'use strict';
|
2011-05-25 19:42:45 +00:00
|
|
|
pandora.ui.backButton = function() {
|
|
|
|
var that = Ox.Button({
|
2013-05-09 10:13:58 +00:00
|
|
|
title: Ox._('Back to {0}', [Ox._(pandora.site.itemName.plural)]),
|
2011-05-25 19:42:45 +00:00
|
|
|
width: 96
|
|
|
|
}).css({
|
|
|
|
float: 'left',
|
2011-10-29 16:57:51 +00:00
|
|
|
margin: '4px 0 0 4px'
|
2011-05-25 19:42:45 +00:00
|
|
|
})
|
|
|
|
.bindEvent({
|
2011-09-17 17:40:15 +00:00
|
|
|
click: function() {
|
2011-10-19 13:00:10 +00:00
|
|
|
/*
|
|
|
|
FIXME: if, on page load, one clicks back quickly,
|
|
|
|
the item content may overwrite the list content.
|
|
|
|
but we cannot cancel all requests, since that
|
|
|
|
might keep the lists folders from loading.
|
|
|
|
so we'd have to cancel with a function -- and
|
|
|
|
it's unclear if the best place for that is here
|
|
|
|
*/
|
2012-02-17 10:06:43 +00:00
|
|
|
if (['accessed', 'timesaccessed'].indexOf(pandora.user.ui.listSort[0].key) > -1) {
|
|
|
|
Ox.Request.clearCache('find');
|
|
|
|
}
|
2011-09-27 22:12:37 +00:00
|
|
|
pandora.UI.set({item: ''});
|
2011-05-25 19:42:45 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
return that;
|
|
|
|
};
|