From 1207a02ef1a7495bd11da105a7bd7f32e1caa2c0 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 3 Oct 2018 13:56:18 -0400
Subject: [PATCH] Bug fix: avoid duplicate initialization.

---
 themes/bootstrap3/js/common.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/themes/bootstrap3/js/common.js b/themes/bootstrap3/js/common.js
index 707461a01ba..8e0fb508df7 100644
--- a/themes/bootstrap3/js/common.js
+++ b/themes/bootstrap3/js/common.js
@@ -31,10 +31,11 @@ var VuFind = (function VuFind() {
     if (_submodules.indexOf(name) === -1) {
       _submodules.push(name);
       this[name] = typeof module == 'function' ? module() : module;
-    }
-    // If the object has already initialized, we should auto-init on register:
-    if (_initialized && this[name].init) {
-      this[name].init();
+
+      // If the object has already initialized, we should auto-init on register:
+      if (_initialized && this[name].init) {
+        this[name].init();
+      }
     }
   };
   var init = function init() {
-- 
GitLab