From dcdcbf703e177218804353124fd4a7711c92f84e Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 3 Sep 2014 23:28:32 +0200 Subject: [PATCH] Minor tweaks. --- src/_h5ai/client/js/inc/ext/preview.js | 8 ++++---- src/_h5ai/client/js/inc/ext/sort.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/_h5ai/client/js/inc/ext/preview.js b/src/_h5ai/client/js/inc/ext/preview.js index da12f9b8..887b307b 100644 --- a/src/_h5ai/client/js/inc/ext/preview.js +++ b/src/_h5ai/client/js/inc/ext/preview.js @@ -3,6 +3,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor var settings = _.extend({ enabled: true }, allsettings.preview); + var $window = $(window); var template = '
' + '
' + @@ -31,7 +32,6 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor function adjustSize() { - var $window = $(window); var winWidth = $window.width(); var winHeight = $window.height(); var $container = $('#pv-content'); @@ -69,14 +69,14 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor $('#pv-content').empty(); setLabels([]); $('#pv-overlay').stop(true, true).fadeIn(200); - $(window).on('keydown', onKeydown); + $window.on('keydown', onKeydown); adjustSize(); } function onExit() { - $(window).off('keydown', onKeydown); + $window.off('keydown', onKeydown); $('#pv-overlay').stop(true, true).fadeOut(200, function () { $('#pv-content').empty(); setLabels([]); @@ -229,7 +229,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor ev.stopImmediatePropagation(); }); - $(window).on('resize load', adjustSize); + $window.on('resize load', adjustSize); } diff --git a/src/_h5ai/client/js/inc/ext/sort.js b/src/_h5ai/client/js/inc/ext/sort.js index c3cea557..c2aa9f8f 100644 --- a/src/_h5ai/client/js/inc/ext/sort.js +++ b/src/_h5ai/client/js/inc/ext/sort.js @@ -185,25 +185,25 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e .find('a.label') .append(template) - .click(function (event) { + .click(function (ev) { sortItems(0, $(this).hasClass('ascending')); - event.preventDefault(); + ev.preventDefault(); }) .end() .find('a.date') .prepend(template) - .click(function (event) { + .click(function (ev) { sortItems(1, $(this).hasClass('ascending')); - event.preventDefault(); + ev.preventDefault(); }) .end() .find('a.size') .prepend(template) - .click(function (event) { + .click(function (ev) { sortItems(2, $(this).hasClass('ascending')); - event.preventDefault(); + ev.preventDefault(); }) .end();