forked from 0x2620/pandora
once item view has loaded, return if the item has changed in the meantime
This commit is contained in:
parent
b1ee22658d
commit
4f0e536466
1 changed files with 8 additions and 15 deletions
|
@ -3,10 +3,11 @@
|
||||||
|
|
||||||
pandora.ui.item = function() {
|
pandora.ui.item = function() {
|
||||||
|
|
||||||
var that = Ox.Element(),
|
var isVideoView = [
|
||||||
isVideoView = [
|
|
||||||
'timeline', 'player', 'editor'
|
'timeline', 'player', 'editor'
|
||||||
].indexOf(pandora.user.ui.itemView) > -1;
|
].indexOf(pandora.user.ui.itemView) > -1,
|
||||||
|
item = pandora.user.ui.item,
|
||||||
|
that = Ox.Element();
|
||||||
|
|
||||||
pandora.api.get({
|
pandora.api.get({
|
||||||
id: pandora.user.ui.item,
|
id: pandora.user.ui.item,
|
||||||
|
@ -17,6 +18,10 @@ pandora.ui.item = function() {
|
||||||
] : []
|
] : []
|
||||||
}, pandora.user.ui.itemView == 'info' && pandora.site.capabilities.canEditMetadata[pandora.user.level] ? 0 : -1, function(result) {
|
}, pandora.user.ui.itemView == 'info' && pandora.site.capabilities.canEditMetadata[pandora.user.level] ? 0 : -1, function(result) {
|
||||||
|
|
||||||
|
if (pandora.user.ui.item != item) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (result.status.code == 200) {
|
if (result.status.code == 200) {
|
||||||
// we want to cache the title in any way, so that after closing
|
// we want to cache the title in any way, so that after closing
|
||||||
// a dialog and getting to this item, the title is correct
|
// a dialog and getting to this item, the title is correct
|
||||||
|
@ -24,18 +29,6 @@ pandora.ui.item = function() {
|
||||||
document.title = pandora.getPageTitle(document.location.pathname) || documentTitle;
|
document.title = pandora.getPageTitle(document.location.pathname) || documentTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (result.status.code != 200) {
|
|
||||||
pandora.$ui.contentPanel.replaceElement(1,
|
|
||||||
Ox.Element()
|
|
||||||
.css({marginTop: '32px', fontSize: '12px', textAlign: 'center'})
|
|
||||||
.html(
|
|
||||||
'Sorry, we can\'t find the '
|
|
||||||
+ pandora.site.itemName.singular.toLowerCase()
|
|
||||||
+ ' you\'re looking for.'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
pandora.$ui.itemTitle
|
pandora.$ui.itemTitle
|
||||||
.options({
|
.options({
|
||||||
title: '<b>' + result.data.title
|
title: '<b>' + result.data.title
|
||||||
|
|
Loading…
Reference in a new issue