Skip to content

Commit ea50818

Browse files
authored
1.0.2
1 parent 5e0af57 commit ea50818

4 files changed

Lines changed: 29 additions & 3 deletions

File tree

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
### 1.0.2
4+
* Automatically add an active class to the first element when no active element was specified
5+
6+
### 1,0.1
7+
* Fixed a naming issue
8+
9+
### 1.0.0
10+
* Initial Release

dist/js/magicline.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,16 @@ var magicLine = (function () {
8585

8686
return null;
8787
});
88-
active = !active.length ? elements[0] : active[0];
88+
89+
if (!active.length) {
90+
active = elements[0];
91+
setActiveElement(elements, {
92+
target: elements[0]
93+
});
94+
} else {
95+
active = active[0];
96+
}
97+
8998
return {
9099
el: active,
91100
rect: active.getBoundingClientRect()

dist/js/magicline.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ export default class magicLine {
6565
return null;
6666
});
6767

68-
active = (!active.length) ? elements[0] : active[0];
68+
if (!active.length) {
69+
active = elements[0];
70+
setActiveElement(elements, {
71+
target: elements[0]
72+
});
73+
} else {
74+
active = active[0];
75+
}
6976

7077
return {
7178
el: active,

0 commit comments

Comments
 (0)