alchemy-widget 0.1.0 → 0.1.1
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.
package/CHANGELOG.md
CHANGED
|
@@ -112,4 +112,43 @@ Awc.setMethod(function introduced() {
|
|
|
112
112
|
|
|
113
113
|
that.toggleToolbar();
|
|
114
114
|
});
|
|
115
|
+
|
|
116
|
+
document.addEventListener('click', e => {
|
|
117
|
+
|
|
118
|
+
if (!this.active_widget) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Ignore clicks on the context element button itself!
|
|
123
|
+
if (e.target == this || this.contains(e.target)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Ignore clicks in the active widget
|
|
128
|
+
if (e.target == this.active_widget || this.active_widget.contains(e.target)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return this.unselectedWidget();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
let update_scroll = () => {
|
|
136
|
+
animation_request = null;
|
|
137
|
+
this.moveToWidget(this.active_widget);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
let animation_request;
|
|
141
|
+
|
|
142
|
+
document.addEventListener('scroll', e => {
|
|
143
|
+
|
|
144
|
+
if (!this.active_widget) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (animation_request != null) {
|
|
149
|
+
cancelAnimationFrame(animation_request);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
animation_request = requestAnimationFrame(update_scroll);
|
|
153
|
+
}, {passive: true});
|
|
115
154
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemy-widget",
|
|
3
3
|
"description": "The widget plugin for the AlchemyMVC",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"author": "Jelle De Loecker <jelle@elevenways.be>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"alchemy",
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"repository": "11ways/alchemy-widget",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"engines": {
|
|
18
|
-
"node" : ">=
|
|
18
|
+
"node" : ">=12.0.0"
|
|
19
19
|
}
|
|
20
20
|
}
|