forked from 0x2620/pandora
move js files from js/pandora to js, fixes #1366
This commit is contained in:
parent
b5eda32bbd
commit
a9b7738aa8
104 changed files with 7 additions and 2 deletions
28
static/js/backButton.js
Normal file
28
static/js/backButton.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||
'use strict';
|
||||
pandora.ui.backButton = function() {
|
||||
var that = Ox.Button({
|
||||
title: Ox._('Back to {0}', [Ox._(pandora.site.itemName.plural)]),
|
||||
width: 96
|
||||
}).css({
|
||||
float: 'left',
|
||||
margin: '4px 0 0 4px'
|
||||
})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
/*
|
||||
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
|
||||
*/
|
||||
if (['accessed', 'timesaccessed'].indexOf(pandora.user.ui.listSort[0].key) > -1) {
|
||||
Ox.Request.clearCache('find');
|
||||
}
|
||||
pandora.UI.set({item: ''});
|
||||
}
|
||||
});
|
||||
return that;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue