@webqit/oohtml 3.1.15 → 3.1.16

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/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "wicg-proposal"
15
15
  ],
16
16
  "homepage": "https://webqit.io/tooling/oohtml",
17
- "version": "3.1.15",
17
+ "version": "3.1.16",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -15,7 +15,7 @@ export default function init( $config = {} ) {
15
15
  attr: { namespace: 'namespace', lid: 'id', },
16
16
  api: { namespace: 'namespace', },
17
17
  tokens: { lidrefPrefix: '~', lidrefSeparator: ':' },
18
- target: { attr: ':target', event: ':target', scrolling: true },
18
+ target: { className: ':target', eventName: ':target', scrolling: true },
19
19
  } );
20
20
  config.lidSelector = `[${ window.CSS.escape( config.attr.lid ) }]`;
21
21
  config.namespaceSelector = `[${ window.CSS.escape( config.attr.namespace ) }]`;
@@ -350,10 +350,10 @@ function realtime( config ) {
350
350
  if ( !window.location.hash?.startsWith( `#${ $lidUtil.lidrefPrefix() }` ) ) return;
351
351
  const path = window.location.hash?.substring( `#${ $lidUtil.lidrefPrefix() }`.length ).split( '/' ).map( s => s.trim() ).filter( s => s ) || [];
352
352
  const currTarget = path.reduce( ( prev, segment ) => prev && prev[ config.api.namespace ][ segment ], window.document );
353
- if ( prevTarget && config.target.attr ) { prevTarget.toggleAttribute( config.target.attr, false ); }
353
+ if ( prevTarget && config.target.className ) { prevTarget.classList.toggle( config.target.className, false ); }
354
354
  if ( currTarget && currTarget !== window.document ) {
355
- if ( config.target.attr ) { currTarget.toggleAttribute( config.target.attr, true ); }
356
- if ( config.target.event ) { currTarget.dispatchEvent( new window.CustomEvent( config.target.event ) ); }
355
+ if ( config.target.className ) { currTarget.classList.toggle( config.target.className, true ); }
356
+ if ( config.target.eventName ) { currTarget.dispatchEvent( new window.CustomEvent( config.target.eventName ) ); }
357
357
  if ( config.target.scrolling && path.length > 1 ) { currTarget.scrollIntoView(); }
358
358
  prevTarget = currTarget;
359
359
  }