Fixes event stack.

This commit is contained in:
Lars Jung 2012-10-19 18:40:07 +02:00
parent e956a49680
commit 3814558ca1
3 changed files with 24 additions and 25 deletions

View File

@ -76,10 +76,12 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event
newAbsHref = encodedHref(newAbsHref);
if (absHref !== newAbsHref) {
absHref = newAbsHref;
event.pub('location.changed', getItem());
notify.set('loading...');
modulejs.require('core/refresh')(function () { notify.set(); });
modulejs.require('core/refresh')(function () {
notify.set();
event.pub('location.changed', getItem());
});
if (history) {
if (keepBrowserUrl) {

View File

@ -1,5 +1,5 @@
modulejs.define('core/refresh', ['_', 'config', 'core/server', 'model/entry', 'core/location'], function (_, config, server, Entry, location) {
modulejs.define('core/refresh', ['_', 'core/server', 'model/entry', 'core/location'], function (_, server, Entry, location) {
var parseJson = function (entry, json) {

View File

@ -27,32 +27,29 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
checkEntry = function (entry) {
if (entry.$extended) {
var type = null;
var type = null;
if (_.indexOf(settings.img, entry.type) >= 0) {
type = 'img';
} else if (_.indexOf(settings.mov, entry.type) >= 0) {
type = 'mov';
} else if (_.indexOf(settings.doc, entry.type) >= 0) {
type = 'doc';
}
if (_.indexOf(settings.img, entry.type) >= 0) {
type = 'img';
} else if (_.indexOf(settings.mov, entry.type) >= 0) {
type = 'mov';
} else if (_.indexOf(settings.doc, entry.type) >= 0) {
type = 'doc';
}
if (type) {
requestThumbSmall(type, entry.absHref, function (src) {
if (type) {
requestThumbSmall(type, entry.absHref, function (src) {
if (src && entry.$extended) {
entry.$extended.find('.icon.small img').addClass('thumb').attr('src', src);
}
});
requestThumbBig(type, entry.absHref, function (src) {
if (src) {
entry.$extended.find('.icon.small img').addClass('thumb').attr('src', src);
}
});
requestThumbBig(type, entry.absHref, function (src) {
if (src) {
entry.$extended.find('.icon.big img').addClass('thumb').attr('src', src);
}
});
}
if (src && entry.$extended) {
entry.$extended.find('.icon.big img').addClass('thumb').attr('src', src);
}
});
}
},