Skip to content

feat(sticky-header): Initial version of sticky header new PRNew Sticky header #5858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 140 commits into from
Jul 25, 2017

Conversation

sllethe
Copy link
Contributor

@sllethe sllethe commented Jul 18, 2017

I closed the old PR (feat(sticky-header): Initial version of sticky header #5175 : #5175) by mistake and it can not be reopened. So this is the new PR...

sllethe added 30 commits July 18, 2017 13:42
add chose parent

add support to 'optional 'cdkStickyRegion' input '

add app-demo for sticky-header

fix bugs and deleted unused tag id in HTML files

modify
…)' function, add its content into 'ngOnDestroy()'.
Use // for comments, /* */ for docs
Copy link
Contributor Author

@sllethe sllethe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments Addressed 👍
Please take another look.

@@ -86,7 +87,9 @@ const MATERIAL_MODULES = [
A11yModule,
PlatformModule,
MdCommonModule,
ObserveContentModule
ObserveContentModule,
CdkDataTableModule,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Deleted CdkDataTableModule

/** boolean value to mark whether the current header is stuck*/
isStuck: boolean = false;
/** Whether the browser support CSS sticky positioning. */
private _isStickyPositionSupported: boolean = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed to '_isPositionStickySupported'

onResize(): void {
this.defineRestrictionsAndStick();
/**
* If there's already a header being stick when the page is
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed to '//'

@angular/cdk
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, mostly just naming / commenting comments from me

this.stickyParent = this.parentRegion != null ?
this.parentRegion._elementRef.nativeElement : this.element.parentElement;

let values = window.getComputedStyle(this.element, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values -> headerStyles

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 renamed: values -> headerStyles

left: values.left,
bottom: values.bottom,
width: values.width,
zIndex: values.zIndex} as CSSStyleDeclaration;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move closing brace to the next line, e.g.

this._originalStyles = {
  position: values.position,
  // ...
  zIndex: values.zIndex,
} as CSSStyleDeclaration;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

ngOnDestroy(): void {
if (this._onScrollSubscription) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do

    [this._onScrollSubscription, this._onScrollSubscription, this._onResizeSubscription]
        .forEach(s => s && s.unsubscribe());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed it to '[this._onScrollSubscription, this._onScrollSubscription, this._onResizeSubscription] .forEach(s => s && s.unsubscribe());'

private _setStrategyAccordingToCompatibility(): void {
this._isPositionStickySupported = isPositionStickySupported();
if (this._isPositionStickySupported) {
this.element.style.top = '0px';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to do just '0' instead of '0px'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed to '0'

if (this._isPositionStickySupported) {
this.element.style.top = '0px';
this.element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
// TODO add css class with both 'sticky' and '-webkit-sticky' on position
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format like TODO(sllethe): ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* will be scrolled up with its cdkStickyRegion element. In this way, the sticky header
* can be changed smoothly when two sticky header meet and the later one need to replace
* the former one.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

  /**
   * Unsticks the header so that it goes back to scrolling normally.
   *
   * This should be called when the element reaches the bottom of its cdkStickyRegion so that it
   * smoothly scrolls out of view as the next sticky-header moves in.
   */

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

right: '0',
left: 'auto',
bottom: '0',
width: this._originalStyles.width};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move closing brace to next line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* a header should be stick and when should it be unstuck by comparing the offsetTop
* of scrollable container with the top and bottom of the sticky region.
*/
sticker(): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like _applyStickyPositionStyles? The name sticker doesn't tell you much about what the function does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed name to 'applyStickyPositionStyles'

if (this.isStuck &&
(currentPosition < this._stickyRegionTop ||
currentPosition > this._stickyRegionBottomThreshold)
|| currentPosition >= this._stickyRegionBottomThreshold) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be consistent whether the operators go at the beginning or the end of the line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
}

defineRestrictionsAndStick(): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe _updateStickyPositioning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed to '_updateStickyPositioning'

sllethe added 15 commits July 24, 2017 15:19
rename : values -> headerStyles
Move closing brace to the next line
optimized: [this._onScrollSubscription, this._onScrollSubscription, this._onResizeSubscription]
        .forEach(s => s && s.unsubscribe());
You should be able to do just '0' instead of '0px'
private _attachEventListeners? Add a description like "Add listeners for events that affect sticky positioning."
optimize doc
Rename 'defineRestrictions' to '_measureStickyRegionBounds'
rename: private _resetElementStyles
let stuckRight: any = this.upperScrollableContainer.getBoundingClientRect().right;
chaned 'any' to 'number'
nit
change doc '/**
   * Unsticks the header so that it goes back to scrolling normally.
   *
   * This should be called when the element reaches the bottom of its cdkStickyRegion so that it
   * smoothly scrolls out of view as the next sticky-header moves in.
   */'
_unstuckElement -> _unstickElement
rename 'defineRestrictionsAndStick()' to '_updateStickyPositioning()'
Copy link
Contributor Author

@sllethe sllethe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments Addressed 👍
Please take another look

this.stickyParent = this.parentRegion != null ?
this.parentRegion._elementRef.nativeElement : this.element.parentElement;

let values = window.getComputedStyle(this.element, '');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 renamed: values -> headerStyles

left: values.left,
bottom: values.bottom,
width: values.width,
zIndex: values.zIndex} as CSSStyleDeclaration;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

ngOnDestroy(): void {
if (this._onScrollSubscription) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed it to '[this._onScrollSubscription, this._onScrollSubscription, this._onResizeSubscription] .forEach(s => s && s.unsubscribe());'

private _setStrategyAccordingToCompatibility(): void {
this._isPositionStickySupported = isPositionStickySupported();
if (this._isPositionStickySupported) {
this.element.style.top = '0px';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed to '0'

if (this._isPositionStickySupported) {
this.element.style.top = '0px';
this.element.style.cssText += 'position: -webkit-sticky; position: sticky; ';
// TODO add css class with both 'sticky' and '-webkit-sticky' on position
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* can be changed smoothly when two sticky header meet and the later one need to replace
* the former one.
*/
private _unstuckElement(): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

right: '0',
left: 'auto',
bottom: '0',
width: this._originalStyles.width};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* a header should be stick and when should it be unstuck by comparing the offsetTop
* of scrollable container with the top and bottom of the sticky region.
*/
sticker(): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed name to 'applyStickyPositionStyles'

if (this.isStuck &&
(currentPosition < this._stickyRegionTop ||
currentPosition > this._stickyRegionBottomThreshold)
|| currentPosition >= this._stickyRegionBottomThreshold) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
}

defineRestrictionsAndStick(): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed to '_updateStickyPositioning'

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will just need unit tests in the next PR before it can be merged into master.

Can be merged after Tina and Andrew approve

@tinayuangao
Copy link
Contributor

LGTM

@andrewseguin
Copy link
Contributor

LGTM :)

@tinayuangao tinayuangao merged commit 4d31485 into angular:sticky-header Jul 25, 2017
sllethe added a commit to sllethe/material2 that referenced this pull request Aug 10, 2017
…y header (angular#5858)

* add lib files for sticky-header

add chose parent

add support to 'optional 'cdkStickyRegion' input '

add app-demo for sticky-header

fix bugs and deleted unused tag id in HTML files

modify

* fix some code according to PR review comments

* change some format to pass TSlint check

* add '_' before private elements

* delete @Injectable for StickyHeaderDirective. Because we do not need @Injectable

* refine code

* encapsulate 'set style for element'

* change @input()

* Delete 'Observable.fromEvent(this.upperScrollableContainer, 'scroll')'

* add const STICK_START_CLASS and STICK_END_CLASS

* Add doc for [cdkStickyRegion] and 'unstuckElement()'. Delete 'detach()' function, add its content into 'ngOnDestroy()'.

* change 'MdStickyHeaderModule' to 'CdkStickyHeaderModule';

* encapsulate reset css style operation for sticky header.

* delete unnecessary gloable variables

* delete global variable '_width'

* Add doc for 'sticker()' function. explained how it works.

* add more doc for 'sticker()', explaining 'isStuck' flag

* 2 space for indent

* fix

* delete sticky-header demo part from this branch

* revert firebase file

* change code according to comments in PR

* revert firbaserc

* revert demo-app.ts

* revert routes.ts

* revert demo-app-module.ts

* change

* fix the problem of : 'this.stickyParent' might be 'null'

* change 'CdkStickyHeaderModule' to 'StickyHeaderModule'

* change doc

* Change the constructor of 'cdkStickyRegion' to 'constructor(public readonly _elementRef: ElementRef) { }'

* Added prefix 'mat-' for CSS class

* Delete 'public' before variables

* Object.assign isn't supported in IE11; use extendObject from src/lib/core/util.

*  IE11 will have trouble with  `translate3d(0, 0, 0);', change to `translate3d(0px, 0px, 0px);'

* Added docs for all variables

* extract 'generate CSS style'

* created a generateStyleCSS() function, let it be responsible for generating all those CSS styles.

* reformat

* add debounce to solve 'getBoundingClientRect() cause slow down' problem.

* add position:sticky and check whether browser support it. If not , use the naive implementation

* removed unused import

* Removed unused 'scrollableRegion' and 'parentRegion'

* removed commented lines

* default public

* Add comments about why setting style top and position for iPhone and not IE. And extract detectBrowser() as a new function

* format

* consider all circumstances of browser.

* use "===" instead of '=='

*  make 'navigator.userAgent.toLocaleLowerCase()' a local variable

* optimize

* Added comments on const 'STICK_START_CLASS' and 'STICK_END_CLASS'.
change their content to cdk-sticky-header-start and cdk-sticky-header-end

* Added comments for STICK_START_CLASS and STICK_END_CLASS.

* Changed the format of one-line JsDoc

* unsubscribe sbscriptions onDestory

* Use what modernizr does on compatibility instead of get the browser version directly.

* add 'padding' and 'stickyRegionHeight' variables to avoid calling 'getComputedStyle()' too many times (which is expensive).

* move docs above @directive

* removed the underscore in'_element: ElementRef',

* expand 'reg' to 'region'

* use 'if (this.isIE)' instead of 'if(this.isIE === true)'

* added more newlines between params in 'generateCssStyle()' function to make it easier to understand.

* Added reference link to Modernizer in docs of getSupportList()

* Deleted "_supportList" variable

* renamed 'isIE' to 'isStickyPositionSupported', and removed extra space before Observable

* Set debounce time as a const variable

* Added docs for 'const DEBOUNCE_TIME: number = 5;'

* Changed ' if(this.stickyParent == null)' to ' if(!this.stickyParent)'

*  Removed the @param and @returns and make sure the types are correct in the function signature in 'generateCssStyle(...)' function

* Added docs for `isStickyPositionSupported` variable

* changed '+=' to '=' of 'stickyText' in getSupportList() function

* nit added " " between 'if' and '('

* nit

* Added comments

* deleted unused import

* change comments

* optimize comments

* deleted unnecessary global variables(padding and stickyRegionHeight)

* Added check whether we are on browser

* Array<string> to string[]

* test?

* try to reopen the old PR

* fix after rebase

* revert list.ts

* test

* test 222

* revert demo

* revert list.ts second time

* Move code to 'src/cdk'

* revert 'move code to 'src/cdk'' , it should be done in a new PR

* revert

* avoid calling 'getComputedStyle()' too many times.

* rename as sticky-header.ts

* rename sticky-header.ts

* imported PlatformModule

* Add blank lines between these top-level symbol

* make '_isStickyPositionSupported' private

* Changed the originalCSS to private and use '{} as CSSStyleDeclaration' instead of ''any.

* Rename '_containerStart' to '_stickyRegionTop'

* rename

* optimize discription for '_stickyRegionBottomThreshold'

* private _originalStyles = {
      position: '',
      top: '',
      right: '',
      left: '',
      bottom: '',
      width:  '',
      zIndex: ''};

* Deleted 'generateCssStyle()' and 'getCssNumber()' function

* Deleted 'getCssValue()' function

* fix CSSStyleDeclaration

* change sticky width to 'this.upperScrollableContainer.clientWidth'

* fix

* nit

* Added isPositionStickySupported() to 'src/cdk/platform/featrues.ts'

* Added the 'isPositionStickySupported() ' function  to src/cdk/platform/features.ts.
Consume that function in this component and just always use both the webkit and unprefixed styles.

* nit

* nit

* update doc 'Debounce time in milliseconds for events that affect the sticky positioning (e.g. scroll, resize, touch move). Set as 5 milliseconds which is the highest delay that doesn't drastically affect the positioning adversely.'

* changed the doc to  '/** z-index to be applied to the sticky header (default is 10). */'

* fix tslint error

* for comment 'Can you evaluate each method to make sure their accessor privacy is right? E.g. see which functions need to be public, private, static, etc'

* Deleted variable 'elemHeight'

* Chaned to 'if (!this.stickyParent)'

* Simplified Docs for 'sticker()'.

* set 'defineRestriction()' function to private

* use 'RxChain'

* deleted unused 'tableModule' in modules.ts

* rename to  '_isPositionStickySupported'

* Use // for comments, /* */ for docs

* @angular/cdk

* rename : values -> headerStyles

* Move closing brace to the next line

* optimized: [this._onScrollSubscription, this._onScrollSubscription, this._onResizeSubscription]
        .forEach(s => s && s.unsubscribe());

* You should be able to do just '0' instead of '0px'

* Format like TODO(sllethe): ...

* private _attachEventListeners? Add a description like "Add listeners for events that affect sticky positioning."

* optimize doc

* Rename 'defineRestrictions' to '_measureStickyRegionBounds'

* rename: private _resetElementStyles

* let stuckRight: any = this.upperScrollableContainer.getBoundingClientRect().right;
chaned 'any' to 'number'

* nit

* change doc '/**
   * Unsticks the header so that it goes back to scrolling normally.
   *
   * This should be called when the element reaches the bottom of its cdkStickyRegion so that it
   * smoothly scrolls out of view as the next sticky-header moves in.
   */'

* _unstuckElement -> _unstickElement

* rename 'sticker()' to '_applyStickyPositionStyles()'

* rename 'defineRestrictionsAndStick()' to '_updateStickyPositioning()'
sllethe added a commit to sllethe/material2 that referenced this pull request Aug 10, 2017
…y header (angular#5858)

* add lib files for sticky-header

add chose parent

add support to 'optional 'cdkStickyRegion' input '

add app-demo for sticky-header

fix bugs and deleted unused tag id in HTML files

modify

* fix some code according to PR review comments

* change some format to pass TSlint check

* add '_' before private elements

* delete @Injectable for StickyHeaderDirective. Because we do not need @Injectable

* refine code

* encapsulate 'set style for element'

* change @input()

* Delete 'Observable.fromEvent(this.upperScrollableContainer, 'scroll')'

* add const STICK_START_CLASS and STICK_END_CLASS

* Add doc for [cdkStickyRegion] and 'unstuckElement()'. Delete 'detach()' function, add its content into 'ngOnDestroy()'.

* change 'MdStickyHeaderModule' to 'CdkStickyHeaderModule';

* encapsulate reset css style operation for sticky header.

* delete unnecessary gloable variables

* delete global variable '_width'

* Add doc for 'sticker()' function. explained how it works.

* add more doc for 'sticker()', explaining 'isStuck' flag

* 2 space for indent

* fix

* delete sticky-header demo part from this branch

* revert firebase file

* change code according to comments in PR

* revert firbaserc

* revert demo-app.ts

* revert routes.ts

* revert demo-app-module.ts

* change

* fix the problem of : 'this.stickyParent' might be 'null'

* change 'CdkStickyHeaderModule' to 'StickyHeaderModule'

* change doc

* Change the constructor of 'cdkStickyRegion' to 'constructor(public readonly _elementRef: ElementRef) { }'

* Added prefix 'mat-' for CSS class

* Delete 'public' before variables

* Object.assign isn't supported in IE11; use extendObject from src/lib/core/util.

*  IE11 will have trouble with  `translate3d(0, 0, 0);', change to `translate3d(0px, 0px, 0px);'

* Added docs for all variables

* extract 'generate CSS style'

* created a generateStyleCSS() function, let it be responsible for generating all those CSS styles.

* reformat

* add debounce to solve 'getBoundingClientRect() cause slow down' problem.

* add position:sticky and check whether browser support it. If not , use the naive implementation

* removed unused import

* Removed unused 'scrollableRegion' and 'parentRegion'

* removed commented lines

* default public

* Add comments about why setting style top and position for iPhone and not IE. And extract detectBrowser() as a new function

* format

* consider all circumstances of browser.

* use "===" instead of '=='

*  make 'navigator.userAgent.toLocaleLowerCase()' a local variable

* optimize

* Added comments on const 'STICK_START_CLASS' and 'STICK_END_CLASS'.
change their content to cdk-sticky-header-start and cdk-sticky-header-end

* Added comments for STICK_START_CLASS and STICK_END_CLASS.

* Changed the format of one-line JsDoc

* unsubscribe sbscriptions onDestory

* Use what modernizr does on compatibility instead of get the browser version directly.

* add 'padding' and 'stickyRegionHeight' variables to avoid calling 'getComputedStyle()' too many times (which is expensive).

* move docs above @directive

* removed the underscore in'_element: ElementRef',

* expand 'reg' to 'region'

* use 'if (this.isIE)' instead of 'if(this.isIE === true)'

* added more newlines between params in 'generateCssStyle()' function to make it easier to understand.

* Added reference link to Modernizer in docs of getSupportList()

* Deleted "_supportList" variable

* renamed 'isIE' to 'isStickyPositionSupported', and removed extra space before Observable

* Set debounce time as a const variable

* Added docs for 'const DEBOUNCE_TIME: number = 5;'

* Changed ' if(this.stickyParent == null)' to ' if(!this.stickyParent)'

*  Removed the @param and @returns and make sure the types are correct in the function signature in 'generateCssStyle(...)' function

* Added docs for `isStickyPositionSupported` variable

* changed '+=' to '=' of 'stickyText' in getSupportList() function

* nit added " " between 'if' and '('

* nit

* Added comments

* deleted unused import

* change comments

* optimize comments

* deleted unnecessary global variables(padding and stickyRegionHeight)

* Added check whether we are on browser

* Array<string> to string[]

* test?

* try to reopen the old PR

* fix after rebase

* revert list.ts

* test

* test 222

* revert demo

* revert list.ts second time

* Move code to 'src/cdk'

* revert 'move code to 'src/cdk'' , it should be done in a new PR

* revert

* avoid calling 'getComputedStyle()' too many times.

* rename as sticky-header.ts

* rename sticky-header.ts

* imported PlatformModule

* Add blank lines between these top-level symbol

* make '_isStickyPositionSupported' private

* Changed the originalCSS to private and use '{} as CSSStyleDeclaration' instead of ''any.

* Rename '_containerStart' to '_stickyRegionTop'

* rename

* optimize discription for '_stickyRegionBottomThreshold'

* private _originalStyles = {
      position: '',
      top: '',
      right: '',
      left: '',
      bottom: '',
      width:  '',
      zIndex: ''};

* Deleted 'generateCssStyle()' and 'getCssNumber()' function

* Deleted 'getCssValue()' function

* fix CSSStyleDeclaration

* change sticky width to 'this.upperScrollableContainer.clientWidth'

* fix

* nit

* Added isPositionStickySupported() to 'src/cdk/platform/featrues.ts'

* Added the 'isPositionStickySupported() ' function  to src/cdk/platform/features.ts.
Consume that function in this component and just always use both the webkit and unprefixed styles.

* nit

* nit

* update doc 'Debounce time in milliseconds for events that affect the sticky positioning (e.g. scroll, resize, touch move). Set as 5 milliseconds which is the highest delay that doesn't drastically affect the positioning adversely.'

* changed the doc to  '/** z-index to be applied to the sticky header (default is 10). */'

* fix tslint error

* for comment 'Can you evaluate each method to make sure their accessor privacy is right? E.g. see which functions need to be public, private, static, etc'

* Deleted variable 'elemHeight'

* Chaned to 'if (!this.stickyParent)'

* Simplified Docs for 'sticker()'.

* set 'defineRestriction()' function to private

* use 'RxChain'

* deleted unused 'tableModule' in modules.ts

* rename to  '_isPositionStickySupported'

* Use // for comments, /* */ for docs

* @angular/cdk

* rename : values -> headerStyles

* Move closing brace to the next line

* optimized: [this._onScrollSubscription, this._onScrollSubscription, this._onResizeSubscription]
        .forEach(s => s && s.unsubscribe());

* You should be able to do just '0' instead of '0px'

* Format like TODO(sllethe): ...

* private _attachEventListeners? Add a description like "Add listeners for events that affect sticky positioning."

* optimize doc

* Rename 'defineRestrictions' to '_measureStickyRegionBounds'

* rename: private _resetElementStyles

* let stuckRight: any = this.upperScrollableContainer.getBoundingClientRect().right;
chaned 'any' to 'number'

* nit

* change doc '/**
   * Unsticks the header so that it goes back to scrolling normally.
   *
   * This should be called when the element reaches the bottom of its cdkStickyRegion so that it
   * smoothly scrolls out of view as the next sticky-header moves in.
   */'

* _unstuckElement -> _unstickElement

* rename 'sticker()' to '_applyStickyPositionStyles()'

* rename 'defineRestrictionsAndStick()' to '_updateStickyPositioning()'
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants