From dd9e9591993f40260add18c9d1b3208db90f6b03 Mon Sep 17 00:00:00 2001
From: Ere Maijala <ere.maijala@helsinki.fi>
Date: Wed, 11 May 2016 14:15:48 +0300
Subject: [PATCH] Publish embedOpenUrlLinks() method in VuFind.openurl so that
 it can be called from other scripts.

---
 themes/bootstrap3/js/openurl.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/themes/bootstrap3/js/openurl.js b/themes/bootstrap3/js/openurl.js
index 28cd7ae7a8f..16a707844e3 100644
--- a/themes/bootstrap3/js/openurl.js
+++ b/themes/bootstrap3/js/openurl.js
@@ -17,7 +17,7 @@ VuFind.register('openurl', function() {
     });
   };
 
-  var _embedOpenUrlLinks = function(element) {
+  var embedOpenUrlLinks = function(element) {
     // Extract the OpenURL associated with the clicked element:
     var openUrl = element.children('span.openUrl:first').attr('title');
 
@@ -53,11 +53,14 @@ VuFind.register('openurl', function() {
 
     // assign action to the openUrlEmbed link class
     container.find('.openUrlEmbed a').unbind('click').click(function() {
-      _embedOpenUrlLinks($(this));
+      embedOpenUrlLinks($(this));
       return false;
     });
 
     container.find('.openUrlEmbed.openUrlEmbedAutoLoad a').trigger('click');
   };
-  return {init: init};
+  return {
+    init: init,
+    embedOpenUrlLinks: embedOpenUrlLinks
+  };
 });
-- 
GitLab