dalila 1.5.6 → 1.5.7
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/dist/runtime/bind.js +4 -3
- package/package.json +1 -1
package/dist/runtime/bind.js
CHANGED
|
@@ -177,14 +177,15 @@ function bindEvents(root, ctx, events, cleanups) {
|
|
|
177
177
|
* Bind all [d-when] directives within root
|
|
178
178
|
*/
|
|
179
179
|
function bindWhen(root, ctx, cleanups) {
|
|
180
|
-
const elements = qsaIncludingRoot(root, '[d-when]');
|
|
180
|
+
const elements = qsaIncludingRoot(root, '[when], [d-when]');
|
|
181
181
|
for (const el of elements) {
|
|
182
|
-
const
|
|
182
|
+
const attrName = el.hasAttribute('when') ? 'when' : 'd-when';
|
|
183
|
+
const bindingName = normalizeBinding(el.getAttribute(attrName));
|
|
183
184
|
if (!bindingName)
|
|
184
185
|
continue;
|
|
185
186
|
const binding = ctx[bindingName];
|
|
186
187
|
if (binding === undefined) {
|
|
187
|
-
warn(`
|
|
188
|
+
warn(`when: "${bindingName}" not found in context`);
|
|
188
189
|
continue;
|
|
189
190
|
}
|
|
190
191
|
const htmlEl = el;
|