From 60802a7bff77bad0b0f962110186b89e05ce041a Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Mon, 13 Jun 2016 16:38:27 -0400
Subject: [PATCH] eslint export typo and lightbox circular reference style fix.

---
 .eslintrc.js                     | 7 +++++--
 themes/bootstrap3/js/lightbox.js | 6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index 2c0894535d0..acec42340a9 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,7 +1,10 @@
-module.export = {
+module.exports = {
   extends: "eslint:recommended",
   env: { "browser": true },
-  globals: { "$": false },
+  globals: {
+    "$": false,
+    "jQuery": false
+  },
   rules: {
     // errors
     "block-scoped-var": "error",
diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index 5cfcf60d182..f39030f98e7 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -77,6 +77,8 @@ VuFind.register('lightbox', function Lightbox() {
    *
    * data-lightbox-ignore = do not submit this form in lightbox
    */
+  var _constrainLink; // function declarations to avoid style warnings
+  var _formSubmit;    // about circular references
   function _update(content) {
     if (!content.match) {
       return;
@@ -200,7 +202,7 @@ VuFind.register('lightbox', function Lightbox() {
    * data-lightbox-post = post data
    * data-lightbox-title = Lightbox title (overrides any title the page provides)
    */
-  function _constrainLink(event) {
+  _constrainLink = function constrainLink(event) {
     if (typeof $(this).data('lightboxIgnore') != 'undefined' || this.attributes.href.value.charAt(0) === '#') {
       return true;
     }
@@ -232,7 +234,7 @@ VuFind.register('lightbox', function Lightbox() {
    *
    * data-lightbox-ignore = do not handle clicking this button in lightbox
    */
-  function _formSubmit(event) {
+  _formSubmit = function formSubmit(event) {
     // Gather data
     var form = event.target;
     var data = $(form).serializeArray();
-- 
GitLab