From 3834d2687fd1bbb43280709668c14ba384ef3954 Mon Sep 17 00:00:00 2001 From: MichaelWest22 Date: Fri, 6 Dec 2024 10:28:40 +1300 Subject: [PATCH] Change to use this-only instead of local --- src/htmx.js | 4 ++-- test/attributes/hx-ext.js | 4 ++-- www/content/attributes/hx-ext.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/htmx.js b/src/htmx.js index 88412af06..aad5724e5 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -4928,9 +4928,9 @@ var htmx = (function() { extensionsToIgnore.push(extensionName.slice(7)) return } - if (extensionName.indexOf('local:') === 0) { + if (extensionName.indexOf('this-only:') === 0) { if (isParentScan) return - extensionName = extensionName.slice(6) + extensionName = extensionName.slice(10) } if (extensionsToIgnore.indexOf(extensionName) < 0) { const extension = extensions[extensionName] diff --git a/test/attributes/hx-ext.js b/test/attributes/hx-ext.js index 13e90fb49..c00592e65 100644 --- a/test/attributes/hx-ext.js +++ b/test/attributes/hx-ext.js @@ -157,10 +157,10 @@ describe('hx-ext attribute', function() { ext5Calls.should.equal(1) }) - it('Extensions can be local properly', function() { + it('Extensions can be applied to this element only properly', function() { this.server.respondWith('GET', '/test', 'Clicked!') - make('
Click Me!' + + make('
Click Me!' + '
') var div1 = byId('div-AA') diff --git a/www/content/attributes/hx-ext.md b/www/content/attributes/hx-ext.md index 0741a8baa..35abaed49 100644 --- a/www/content/attributes/hx-ext.md +++ b/www/content/attributes/hx-ext.md @@ -25,10 +25,10 @@ hierarchy and it will apply to all child elements.
``` -* If an extension needs to apply only to a single element you can override inheritance on an element using `hx-ext="local:extensionName"` +* If an extension needs to apply only to a single element you can override inheritance on an element using `hx-ext="this-only:extensionName"` ```html -
+
... but it will not be used in this part.