summaryrefslogtreecommitdiffstats
path: root/data/js
diff options
context:
space:
mode:
Diffstat (limited to 'data/js')
-rw-r--r--data/js/application.js12
-rw-r--r--data/js/script.js7
2 files changed, 11 insertions, 8 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});
+ }
}
};
diff --git a/data/js/script.js b/data/js/script.js
deleted file mode 100644
index 7b103699a..000000000
--- a/data/js/script.js
+++ /dev/null
@@ -1,7 +0,0 @@
-(function($) {
- $(function() {
- if ($("img.lazyload").length) {
- $("img.lazyload").show().lazyload({treshold: 200});
- }
- });
-})(jQuery);