mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Minor tweaks.
This commit is contained in:
parent
6fbe0e5056
commit
dcdcbf703e
2 changed files with 10 additions and 10 deletions
|
@ -3,6 +3,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
var settings = _.extend({
|
var settings = _.extend({
|
||||||
enabled: true
|
enabled: true
|
||||||
}, allsettings.preview);
|
}, allsettings.preview);
|
||||||
|
var $window = $(window);
|
||||||
var template =
|
var template =
|
||||||
'<div id="pv-overlay" class="noSelection">' +
|
'<div id="pv-overlay" class="noSelection">' +
|
||||||
'<div id="pv-content"/>' +
|
'<div id="pv-content"/>' +
|
||||||
|
@ -31,7 +32,6 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
|
|
||||||
function adjustSize() {
|
function adjustSize() {
|
||||||
|
|
||||||
var $window = $(window);
|
|
||||||
var winWidth = $window.width();
|
var winWidth = $window.width();
|
||||||
var winHeight = $window.height();
|
var winHeight = $window.height();
|
||||||
var $container = $('#pv-content');
|
var $container = $('#pv-content');
|
||||||
|
@ -69,14 +69,14 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
$('#pv-content').empty();
|
$('#pv-content').empty();
|
||||||
setLabels([]);
|
setLabels([]);
|
||||||
$('#pv-overlay').stop(true, true).fadeIn(200);
|
$('#pv-overlay').stop(true, true).fadeIn(200);
|
||||||
$(window).on('keydown', onKeydown);
|
$window.on('keydown', onKeydown);
|
||||||
|
|
||||||
adjustSize();
|
adjustSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onExit() {
|
function onExit() {
|
||||||
|
|
||||||
$(window).off('keydown', onKeydown);
|
$window.off('keydown', onKeydown);
|
||||||
$('#pv-overlay').stop(true, true).fadeOut(200, function () {
|
$('#pv-overlay').stop(true, true).fadeOut(200, function () {
|
||||||
$('#pv-content').empty();
|
$('#pv-content').empty();
|
||||||
setLabels([]);
|
setLabels([]);
|
||||||
|
@ -229,7 +229,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
ev.stopImmediatePropagation();
|
ev.stopImmediatePropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on('resize load', adjustSize);
|
$window.on('resize load', adjustSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -185,25 +185,25 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
||||||
|
|
||||||
.find('a.label')
|
.find('a.label')
|
||||||
.append(template)
|
.append(template)
|
||||||
.click(function (event) {
|
.click(function (ev) {
|
||||||
sortItems(0, $(this).hasClass('ascending'));
|
sortItems(0, $(this).hasClass('ascending'));
|
||||||
event.preventDefault();
|
ev.preventDefault();
|
||||||
})
|
})
|
||||||
.end()
|
.end()
|
||||||
|
|
||||||
.find('a.date')
|
.find('a.date')
|
||||||
.prepend(template)
|
.prepend(template)
|
||||||
.click(function (event) {
|
.click(function (ev) {
|
||||||
sortItems(1, $(this).hasClass('ascending'));
|
sortItems(1, $(this).hasClass('ascending'));
|
||||||
event.preventDefault();
|
ev.preventDefault();
|
||||||
})
|
})
|
||||||
.end()
|
.end()
|
||||||
|
|
||||||
.find('a.size')
|
.find('a.size')
|
||||||
.prepend(template)
|
.prepend(template)
|
||||||
.click(function (event) {
|
.click(function (ev) {
|
||||||
sortItems(2, $(this).hasClass('ascending'));
|
sortItems(2, $(this).hasClass('ascending'));
|
||||||
event.preventDefault();
|
ev.preventDefault();
|
||||||
})
|
})
|
||||||
.end();
|
.end();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue