info view: get rid of browserImages var; editor: update browser icon on poster frame change

This commit is contained in:
rolux 2013-03-02 14:54:57 +05:30
parent c9737d2ded
commit 06ac4b9c6e
2 changed files with 18 additions and 6 deletions

View file

@ -199,7 +199,15 @@ pandora.ui.editor = function(data) {
} }
if (ui.listSort[0].key == 'modified') { if (ui.listSort[0].key == 'modified') {
Ox.Request.clearCache('find'); Ox.Request.clearCache('find');
pandora.$ui.browser.reloadList(); pandora.$ui.browser
.reloadList()
.bindEventOnce({
load: function() {
updateBrowser();
}
});
} else {
updateBrowser();
} }
}); });
}, },
@ -256,6 +264,14 @@ pandora.ui.editor = function(data) {
} }
}); });
function updateBrowser() {
pandora.$ui.browser.find('img[src*="/' + data.id + '/"]').each(function() {
$(this).attr({
src: '/' + data.id + '/' + ui.icons.slice(0, -1) + '128.jpg?' + Ox.uid()
});
});
}
return that; return that;
}; };

View file

@ -3,7 +3,6 @@
pandora.ui.infoView = function(data) { pandora.ui.infoView = function(data) {
var ui = pandora.user.ui, var ui = pandora.user.ui,
browserImages = [],
canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level], canEdit = pandora.site.capabilities.canEditMetadata[pandora.user.level],
canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level], canRemove = pandora.site.capabilities.canRemoveItems[pandora.user.level],
css = { css = {
@ -435,10 +434,7 @@ pandora.ui.infoView = function(data) {
if (Ox.contains(['title', 'director', 'year'], key)) { if (Ox.contains(['title', 'director', 'year'], key)) {
pandora.clearIconCache(data.id); pandora.clearIconCache(data.id);
if (ui.icons == 'posters') { if (ui.icons == 'posters') {
if (browserImages.length == 0) { pandora.$ui.browser.find('img[src*="/' + data.id + '/"]').each(function() {
browserImages = pandora.$ui.browser.find('img[src*="/' + data.id + '/"]');
}
browserImages.each(function() {
$(this).attr({ $(this).attr({
src: '/' + data.id + '/poster128.jpg?' + Ox.uid() src: '/' + data.id + '/poster128.jpg?' + Ox.uid()
}); });