easy-navigation 2.1.5 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,18 +14,6 @@ export default class AccordionItem extends Element {
14
14
  return articles;
15
15
  }
16
16
 
17
- getAccordionDiv() {
18
- const { AccordionDiv } = this.constructor;
19
-
20
- return AccordionDiv;
21
- }
22
-
23
- getAccordionButton() {
24
- const { AccordionButton } = this.constructor;
25
-
26
- return AccordionButton;
27
- }
28
-
29
17
  getArticleIndex(uri) {
30
18
  const { Articles } = this.properties,
31
19
  articleIndex = Articles.findIndex((Article) => {
@@ -106,9 +94,12 @@ export default class AccordionItem extends Element {
106
94
  const articleIndex = this.getArticleIndex(uri),
107
95
  articleFirstArticle = (articleIndex === 0);
108
96
 
109
- articleFirstArticle ?
110
- this.disableButton():
111
- this.enableButton();
97
+ if (articleFirstArticle) {
98
+ this.disableButton();
99
+ this.blurButton();
100
+ } else {
101
+ this.enableButton();
102
+ }
112
103
  }
113
104
 
114
105
  expand(initialHeight, instantly) {
@@ -120,10 +111,9 @@ export default class AccordionItem extends Element {
120
111
  }
121
112
 
122
113
  childElements() {
123
- const { Articles, first, last, showArticle } = this.properties,
114
+ const { AccordionDiv, AccordionButton } = this.constructor,
115
+ { Articles, first, last, showArticle } = this.properties,
124
116
  [ Article ] = Articles,
125
- AccordionDiv = this.getAccordionDiv(),
126
- AccordionButton = this.getAccordionButton(),
127
117
  articles = Articles.map((Article, index) =>
128
118
 
129
119
  <Article index={index} />
@@ -147,6 +137,7 @@ export default class AccordionItem extends Element {
147
137
  "expandDiv",
148
138
  "isCollapsed",
149
139
  "collapseDiv",
140
+ "blurButton",
150
141
  "enableButton",
151
142
  "disableButton",
152
143
  "activateButton",
@@ -7,16 +7,10 @@ import { Element } from "easy";
7
7
  import AccordionNavigationButton from "../../button/navigation/accordion";
8
8
 
9
9
  class AccordionNavigationItem extends Element {
10
- getAccordionNavigationButton() {
11
- const { AccordionNavigationButton } = this.constructor;
12
-
13
- return AccordionNavigationButton;
14
- }
15
-
16
10
  childElements() {
17
11
  const { Articles, first, last, showArticle } = this.properties,
18
- [ Article ] = Articles,
19
- AccordionNavigationButton = this.getAccordionNavigationButton();
12
+ { AccordionNavigationButton } = this.constructor,
13
+ [ Article ] = Articles;
20
14
 
21
15
  return (
22
16
 
@@ -9,12 +9,6 @@ import AccordionNavigationItem from "../../item/navigation/accordion";
9
9
  import { guaranteeArray } from "../../utilities/array";
10
10
 
11
11
  class AccordionNavigationList extends Element {
12
- getAccordionNavigationItem() {
13
- const { AccordionNavigationItem } = this.constructor;
14
-
15
- return AccordionNavigationItem;
16
- }
17
-
18
12
  getButtons() {
19
13
  const maximumDepth = 2,
20
14
  buttonDescendantElements = this.getDescendantElements("button", maximumDepth),
@@ -29,16 +23,19 @@ class AccordionNavigationList extends Element {
29
23
  buttons.forEach((button) => {
30
24
  const uriArticleURI = button.isURIArticleURI(uri);
31
25
 
32
- (uriArticleURI) ?
33
- button.disable() :
34
- button.enable();
26
+ if (uriArticleURI) {
27
+ button.disable();
28
+ button.blur();
29
+ } else {
30
+ button.enable();
31
+ }
35
32
  });
36
33
  }
37
34
 
38
35
  childElements() {
39
- const { ArticlesArray, showArticle } = this.properties,
36
+ const { AccordionNavigationItem } = this.constructor,
37
+ { ArticlesArray, showArticle } = this.properties,
40
38
  ArticlesArrayLength = ArticlesArray.length,
41
- AccordionNavigationItem = this.getAccordionNavigationItem(),
42
39
  firstIndex = 0,
43
40
  lastIndex = ArticlesArrayLength - 1,
44
41
  items = ArticlesArray.map((ArticleOrArticles, index) => {
@@ -5,15 +5,9 @@ import { Element } from "easy";
5
5
  import AccordionNavigationList from "../list/navigation/accordion";
6
6
 
7
7
  export default class AccordionNavigation extends Element {
8
- getAccordionNavigationList() {
9
- const { AccordionNavigationList } = this.constructor;
10
-
11
- return AccordionNavigationList;
12
- }
13
-
14
8
  childElements() {
15
- const { ArticlesArray, showArticle } = this.properties,
16
- AccordionNavigationList = this.getAccordionNavigationList();
9
+ const { AccordionNavigationList } = this.constructor,
10
+ { ArticlesArray, showArticle } = this.properties;
17
11
 
18
12
  return (
19
13