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 +4 -4
- data/README.md +1 -0
- data/app/assets/javascripts/arclight/context_navigation.js +16 -4
- data/lib/arclight/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffb0e7f0e6d54172720fc8d8dfec4d74f3769598d773cc0f9aa3d6a81fa77ec4
|
4
|
+
data.tar.gz: 34a2c7bf7a1251fe698ef31ea38bcb3a293caec92bc8dd9c9d870abbd68aa7cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a36552276cfc00cd94ded17ab38c08b3c50fa39ab6f9765bc258fe3136228ce02cd73175bb95075b5aa4cb5a6e1fbec8672a197ad5856550fda2525471fb0f
|
7
|
+
data.tar.gz: b408dcace825e2a96ee936e370545e087567837e3c8e49e419f654a92a1c651ce9029260f0371c59c3d2e7dafae836c86a7c2d07f51920fe8a059fb9bd837ebb
|
data/README.md
CHANGED
@@ -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
|
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
|
-
|
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
|
-
|
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(
|
381
|
+
const contextNavigation = new ContextNavigation(
|
382
|
+
e, $(this).data('arclight').originalParents, $(this).data('arclight').originalDocument
|
383
|
+
);
|
372
384
|
contextNavigation.getData();
|
373
385
|
});
|
374
386
|
});
|
data/lib/arclight/version.rb
CHANGED
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.
|
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:
|
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.
|
482
|
+
rubygems_version: 3.1.1
|
483
483
|
signing_key:
|
484
484
|
specification_version: 4
|
485
485
|
summary: ''
|