@advanced-rest-client/arc-scroll-target-mixin
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -32,4 +32,3 @@ /** | ||
static get properties() { | ||
const top = super.properties || {}; | ||
const props = { | ||
return { | ||
/** | ||
@@ -70,12 +69,13 @@ * Specifies the element that will handle the scroll event | ||
*/ | ||
_scrollTarget: { | ||
type: HTMLElement, | ||
attribute: 'scroll-target' | ||
} | ||
scrollTarget: { type: HTMLElement }, | ||
/** | ||
* The `scroll-target` attribute is deprecated as it is inconsistent | ||
* with web platform attributes. | ||
* @type {HTMLElement} | ||
* @deprecated Use `scrolltarget` attribute instead | ||
*/ | ||
_legacyTarget: { type: HTMLElement, attribute: 'scroll-target' } | ||
}; | ||
return Object.assign({}, top, props); | ||
} | ||
/** | ||
* | ||
*/ | ||
get scrollTarget() { | ||
@@ -90,5 +90,13 @@ return this._scrollTarget; | ||
this._scrollTarget = value; | ||
this._scrollTargetChanged(value, this._isAttached); | ||
this._scrollTargetChanged(value); | ||
} | ||
get _legacyTarget() { | ||
return this._scrollTarget; | ||
} | ||
set _legacyTarget(value) { | ||
this.scrollTarget = value; | ||
} | ||
get isAttached() { | ||
@@ -100,3 +108,3 @@ return this._isAttached; | ||
this._isAttached = value; | ||
this._scrollTargetChanged(this._scrollTarget, value); | ||
this._scrollTargetChanged(this._scrollTarget); | ||
} | ||
@@ -195,3 +203,3 @@ | ||
if (!this._oldScrollTarget && this.scrollTarget) { | ||
this._scrollTargetChanged(this._scrollTarget, this._isAttached); | ||
this._scrollTargetChanged(this._scrollTarget); | ||
} | ||
@@ -214,3 +222,3 @@ }); | ||
_scrollTargetChanged(scrollTarget, isAttached) { | ||
_scrollTargetChanged(scrollTarget) { | ||
if (this._oldScrollTarget) { | ||
@@ -220,3 +228,3 @@ this._toggleScrollListener(false, this._oldScrollTarget); | ||
} | ||
if (!isAttached) { | ||
if (!this.isAttached) { | ||
return; | ||
@@ -315,3 +323,3 @@ } | ||
} | ||
let eventTarget = scrollTarget === this._doc ? window : scrollTarget; | ||
const eventTarget = scrollTarget === this._doc ? window : scrollTarget; | ||
if (yes) { | ||
@@ -318,0 +326,0 @@ if (!this._boundScrollHandler) { |
{ | ||
"name": "@advanced-rest-client/arc-scroll-target-mixin", | ||
"description": "arc-scroll-target-mixin is a port of iron-scroll-target-behavior that works with LitElement", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "main": "arc-scroll-target-mixin.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15755
5
314