mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-20 04:20:00 +01:00
Fixes problems with misalgined image previews.
This commit is contained in:
parent
864687aedf
commit
2282a0ba71
src/_h5ai/js/inc
@ -129,9 +129,15 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
|
||||
clearTimeout(spinnerTimeout);
|
||||
$container.spin(false);
|
||||
|
||||
$img.attr('src', src).show();
|
||||
// $img.hide().attr('src', src).fadeIn(100);
|
||||
$img.fadeOut(100, function () {
|
||||
|
||||
adjustSize();
|
||||
$img.attr('src', src).fadeIn(200);
|
||||
setTimeout(adjustSize, 1);
|
||||
});
|
||||
|
||||
// adjustSize();
|
||||
// setTimeout(adjustSize, 1);
|
||||
|
||||
$('#preview-bar-label').text(currentEntries[currentIdx].label);
|
||||
$('#preview-bar-percent').text('' + (100 * $img.width() / width).toFixed(0) + '%');
|
||||
|
@ -31,27 +31,15 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty
|
||||
|
||||
sequence = sequence.replace(/\/+/g, '/');
|
||||
if (sequence === '/') {
|
||||
return {
|
||||
parent: null,
|
||||
parentname: null,
|
||||
name: '/'
|
||||
};
|
||||
return { parent: null, name: '/' };
|
||||
}
|
||||
match = reSplitPath2.exec(sequence);
|
||||
if (match) {
|
||||
return {
|
||||
parent: match[1],
|
||||
parentname: match[2],
|
||||
name: match[3]
|
||||
};
|
||||
return { parent: match[1], name: match[3] };
|
||||
}
|
||||
match = reSplitPath.exec(sequence);
|
||||
if (match) {
|
||||
return {
|
||||
parent: '/',
|
||||
parentname: '/',
|
||||
name: match[1]
|
||||
};
|
||||
return { parent: '/', name: match[1] };
|
||||
}
|
||||
},
|
||||
|
||||
@ -127,7 +115,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, ty
|
||||
return modulejs.require('ext/folderstatus');
|
||||
} catch (e) {}
|
||||
|
||||
return [];
|
||||
return {};
|
||||
}()),
|
||||
|
||||
fetchStatus = function (absHref, callback) {
|
||||
|
@ -12,16 +12,16 @@ modulejs.define('parser/generic-json', ['_', '$', 'core/settings', 'model/entry'
|
||||
|
||||
parseJson = function (absHref, json) {
|
||||
|
||||
if (json.hasOwnProperty('customHeader')) {
|
||||
if (_.has(json, 'customHeader')) {
|
||||
settings.custom.header = json.customHeader;
|
||||
}
|
||||
if (json.hasOwnProperty('customFooter')) {
|
||||
if (_.has(json, 'customFooter')) {
|
||||
settings.custom.footer = json.customFooter;
|
||||
}
|
||||
if (json.hasOwnProperty('mode')) {
|
||||
if (_.has(json, 'mode')) {
|
||||
parser.mode = json.mode;
|
||||
}
|
||||
if (json.hasOwnProperty('server')) {
|
||||
if (_.has(json, 'server')) {
|
||||
parser.server = json.server;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user