summaryrefslogtreecommitdiffstats
path: root/data/js/application.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/js/application.js')
-rw-r--r--data/js/application.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/data/js/application.js b/data/js/application.js
index dedefbc3b..c503da4f1 100644
--- a/data/js/application.js
+++ b/data/js/application.js
@@ -20,7 +20,10 @@ define(
Uploader,
TableSorter
) {
- require(['script']);
+ var ui = {
+ lazyLoadingImages: 'img.lazyload'
+ };
+
var App = {
// Gets called for every request (before page load)
initialize: function () {
@@ -42,6 +45,7 @@ define(
this.configureTooltips();
this.setupToggleSelectAllEvent();
this.setupLineWrapToggle();
+ this.setupLazyLoadingImages();
},
setupLineHighlight: function () {
@@ -71,6 +75,12 @@ define(
Util.setLineWrap(linesWrapped === 'true');
$('.linewrap-toggle').on('click', _.bind(Util.toggleLineWrap, Util));
+ },
+
+ setupLazyLoadingImages: function () {
+ if ($(ui.lazyLoadingImages).length > 0) {
+ $(ui.lazyLoadingImages).show().lazyload({treshold: 200});
+ }
}
};