arclight 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1e2cb448d566788ea1305d2c0d8637427db85d1e053c58e53aa815a242b61fd
4
- data.tar.gz: 9894a2d18a455ebe5a8e73d8c8fc12b85c47bec741b9633bfeab6d6e68610788
3
+ metadata.gz: ffb0e7f0e6d54172720fc8d8dfec4d74f3769598d773cc0f9aa3d6a81fa77ec4
4
+ data.tar.gz: 34a2c7bf7a1251fe698ef31ea38bcb3a293caec92bc8dd9c9d870abbd68aa7cd
5
5
  SHA512:
6
- metadata.gz: 445ae2035ef21b80534d7cdfd6ee3d2996ce4504cb7e86598036d21c26808f7cafab2973d41e671492a4d28b238fce751bedfa5f8b601eb7cbe16faa17442445
7
- data.tar.gz: 0c2782bd753200360c9b17b82a01ac7de3610a58584def844a97ba0b4d1bf7ce25bb4171c75f938b9fc57d142e554d032625b5c8b0c2d10ea06279a3da19c642
6
+ metadata.gz: e6a36552276cfc00cd94ded17ab38c08b3c50fa39ab6f9765bc258fe3136228ce02cd73175bb95075b5aa4cb5a6e1fbec8672a197ad5856550fda2525471fb0f
7
+ data.tar.gz: b408dcace825e2a96ee936e370545e087567837e3c8e49e419f654a92a1c651ce9029260f0371c59c3d2e7dafae836c86a7c2d07f51920fe8a059fb9bd837ebb
data/README.md CHANGED
@@ -12,6 +12,7 @@ A Rails engine supporting discovery of archival materials, based on [Blacklight]
12
12
 
13
13
  * [Ruby](https://www.ruby-lang.org/en/) 2.5 or later
14
14
  * [Rails](http://rubyonrails.org) 5.0 or later
15
+ * Solr 8.1 or later
15
16
 
16
17
  ## Installation
17
18
 
@@ -123,20 +123,27 @@ class ContextNavigation {
123
123
  this.data = this.el.data();
124
124
  this.parentLi = this.el.parent();
125
125
  this.eadid = this.data.arclight.eadid;
126
- this.originalParents = originalParents || this.data.arclight.originalParents;
126
+ this.originalParents = originalParents; // let originalParents stay null
127
127
  this.originalDocument = originalDocument || this.data.arclight.originalDocument;
128
128
  this.ul = $('<ul class="al-context-nav-parent"></ul>');
129
129
  }
130
130
 
131
131
  // Gets the targetId to select, based off of parents and current level
132
132
  get targetId() {
133
- return `${this.eadid}${this.originalParents[this.data.arclight.level]}`;
133
+ if (this.originalParents && this.originalParents[this.data.arclight.level]) {
134
+ return `${this.eadid}${this.originalParents[this.data.arclight.level]}`;
135
+ }
136
+ return this.data.arclight.originalDocument;
134
137
  }
135
138
 
136
139
  get requestParent() {
140
+ // Cases where you're viewing a component page (use its ancestor trail)...
137
141
  if (this.originalParents && this.originalParents[this.data.arclight.level - 1]) {
138
142
  return this.originalParents[this.data.arclight.level - 1];
139
143
  }
144
+ // Cases where there are no parents provided...
145
+ // 1) when on a top-level collection page
146
+ // 2) when +/- gets clicked
140
147
  return this.data.arclight.originalDocument.replace(this.eadid, '');
141
148
  }
142
149
 
@@ -353,7 +360,10 @@ class ContextNavigation {
353
360
  if (!targetArea.data().resolved) {
354
361
  targetArea.find('.context-navigator').each((i, ee) => {
355
362
  const contextNavigation = new ContextNavigation(
356
- ee, that.originalParents, that.originalDocument
363
+ // Send null for originalParents. We want to disregard the original
364
+ // component's ancestor trail and instead use the current ID as the
365
+ // parent in the query to populate the navigator.
366
+ ee, null, that.originalDocument
357
367
  );
358
368
  contextNavigation.getData();
359
369
  });
@@ -368,7 +378,9 @@ class ContextNavigation {
368
378
  */
369
379
  Blacklight.onLoad(function () {
370
380
  $('.context-navigator').each(function (i, e) {
371
- const contextNavigation = new ContextNavigation(e);
381
+ const contextNavigation = new ContextNavigation(
382
+ e, $(this).data('arclight').originalParents, $(this).data('arclight').originalDocument
383
+ );
372
384
  contextNavigation.getData();
373
385
  });
374
386
  });
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arclight
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arclight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Hardy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2019-10-29 00:00:00.000000000 Z
14
+ date: 2020-03-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: blacklight
@@ -479,7 +479,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
479
479
  - !ruby/object:Gem::Version
480
480
  version: '0'
481
481
  requirements: []
482
- rubygems_version: 3.0.3
482
+ rubygems_version: 3.1.1
483
483
  signing_key:
484
484
  specification_version: 4
485
485
  summary: ''