Skip to content

Sticky header demo code - #6033

Merged
sllethe merged 16 commits into
angular:sticky-headerfrom
sllethe:sticky-header-demo
Aug 1, 2017
Merged

Sticky header demo code#6033
sllethe merged 16 commits into
angular:sticky-headerfrom
sllethe:sticky-header-demo

Conversation

@sllethe

Copy link
Copy Markdown
Contributor

No description provided.

@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 25, 2017
@sllethe
slletheforce-pushed the sticky-header-demo branch from 37e733d to 351a96bCompareJuly 25, 2017 20:49
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 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 '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
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 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
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'
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()'
Add demo to sticky-header
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
# This is the 1st commit message:
# This is a combination of 3 commits.
# This is the 1st commit message:
# This is a combination of 6 commits.
# This is the 1st commit message:
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()'.
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
# This is the commit message angular#2:
revert firebase file
# This is the commit message angular#3:
change code according to comments in PR
# This is the commit message angular#4:
revert firbaserc
# This is the commit message angular#5:
revert demo-app.ts
# This is the commit message angular#6:
revert routes.ts
# This is the commit message angular#2:
change
# This is the commit message angular#3:
fix the problem of : 'this.stickyParent' might be 'null'
# This is the commit message angular#2:
change doc
# This is the commit message angular#3:
Change the constructor of 'cdkStickyRegion' to 'constructor(public readonly _elementRef: ElementRef) { }'
# This is the commit message angular#4:
Added prefix 'mat-' for CSS class
# This is the commit message angular#5:
Delete 'public' before variables
# This is the commit message angular#6:
Object.assign isn't supported in IE11; use extendObject from src/lib/core/util.
# This is the commit message angular#7:
IE11 will have trouble with `translate3d(0, 0, 0);', change to `translate3d(0px, 0px, 0px);'
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()'.
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
change
fix the problem of : 'this.stickyParent' might be 'null'
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
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 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
slletheforce-pushed the sticky-header-demo branch from 351a96b to 352f87bCompareJuly 25, 2017 20:54
-moz-appearance: none;
appearance: none;
height: 500px;
//width: 900px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

removed 👍

<h1>Sticky-header Demo</h1>
</div>

<div id="testFor" class="container">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove id? It's not used anywhere

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Removed id

<div id="testFor" class="container">

<div>
<div cdkStickyHeader class="rside1" >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is rside? Use some meaningful name for classes?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Changed them to 'headerColor1', 'headerColor2' and 'headerColor3'.


.rside1 {
background: #cecece;
-webkit-appearance: none;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: You have lots of duplicate of -webkit-appearance: none;padding: 20px;. Merge them into one?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 merged them into one CSS class 'headerStyle'

@sllethe
changed class name to a more meaningful name
@sllethe
removed unused CSS
@sllethe
You have lots of duplicate of -webkit-appearance: none;padding: 20px;. Merge them into one

@sllethesllethe left a comment

Copy link
Copy Markdown
ContributorAuthor

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.

<h1>Sticky-header Demo</h1>
</div>

<div id="testFor" class="container">

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Removed id

<div id="testFor" class="container">

<div>
<div cdkStickyHeader class="rside1" >

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Changed them to 'headerColor1', 'headerColor2' and 'headerColor3'.

-moz-appearance: none;
appearance: none;
height: 500px;
//width: 900px;

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

removed 👍


.rside1 {
background: #cecece;
-webkit-appearance: none;

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 merged them into one CSS class 'headerStyle'

<div class="container">

<div>
<div cdkStickyHeader class="headerStyle headerColor1" >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: use header-style and header-color1

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Changed to header-style and header-color1header-color2header-color3

<P>test sticky-header</P>
<P>test sticky-header</P>
<P>test sticky-header</P>
<P>test sticky-header</P>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

very nit: add some different text so we can see the changes?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 added some different text so we can see the changes

@sllethe
nit: use header-style and header-color1
@sllethe
very nit: add some different text so we can see the changes?
@sllethe

Copy link
Copy Markdown
ContributorAuthor

Comments Addressed 👍
Please take another look.

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trying it out, there seems to be a gap between the headers when one starts pushing another:
image

{path: 'style', component: StyleDemo},
{path: 'typography', component: TypographyDemo},
{path: 'expansion', component: ExpansionDemo},
{path: 'sticky-header', component: StickyHeaderDemo}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add this to the navItems in demo-app.ts?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Added to navItems in demo-app.ts

display: block;
}

.centered {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prefix demo classes with demo-

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Added prefix demo- to demo classes

@andrewseguinandrewseguin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@sllethe
fix according to comments in pr
@sllethe

Copy link
Copy Markdown
ContributorAuthor

Comments Addressed 👍
Please take another look

And @jelbourn , the gap between the headers when one starts pushing another is caused by the default spaces between two <div>s.
The demo code is like this:

<div cdkStickyRegion id="r1">
<div cdkStickyHeader class="demo-header-style demo-header-color2">
<h2>Late Messages</h2>
</div>
<P *ngFor="let item of items">{{item.name}} : {{item.messages}}</P>
</div>
<div cdkStickyRegion id="r2">
<div cdkStickyHeader class="demo-header-style demo-header-color2">
<h2>Late Messages</h2>
</div>
<P *ngFor="let item of items">{{item.name}} : {{item.messages}}</P>
</div>

and the space is because there are spaces between <div cdkStickyRegion id="r1"></div> and <div cdkStickyRegion id="r2"></div>


p {
text-indent: 4em;
margin-bottom: 1.5em;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As discussed, this margin-bottom is what's causing the space between the headers. You can use :not(:last-child) to avoid putting the margin on the last item in the list to prevent it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 Cool!
Changed margin to padding in CSS style file to avoid the extra white space between two <div>s

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

I think you just need Tina's approval now

<div cdkStickyHeader class="demo-header-style demo-header-color2">
<h2>Late Messages</h2>
</div>
<P *ngFor="let item of items">{{item.name}} : {{item.messages}}</P>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change to lower case p?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

👍 <P> -> <p>

@sllethe
P -> p

@tinayuangaotinayuangao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@sllethe
sllethe merged commit 54b6c84 into angular:sticky-headerAug 1, 2017
sllethe added a commit to sllethe/material2 that referenced this pull request Aug 10, 2017
* 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 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 '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
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 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
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'
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()'
Add demo to sticky-header
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
* # This is a combination of 7 commits.
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()'.
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
change
fix the problem of : 'this.stickyParent' might be 'null'
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);'
* 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()'.
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
change
fix the problem of : 'this.stickyParent' might be 'null'
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
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 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()'
* Add demo to sticky-header
* revert
* deleted HEAD file
* removed unused 'id'
* changed class name to a more meaningful name
* removed unused CSS
* You have lots of duplicate of -webkit-appearance: none;padding: 20px;. Merge them into one
* nit
* nit: use header-style and header-color1
* very nit: add some different text so we can see the changes?
* fix according to comments in pr
* fix white space between different <div>s
* P -> p
sllethe added a commit to sllethe/material2 that referenced this pull request Aug 10, 2017
* 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 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 '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
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 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
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'
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()'
Add demo to sticky-header
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
* # This is a combination of 7 commits.
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()'.
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
change
fix the problem of : 'this.stickyParent' might be 'null'
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);'
* 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()'.
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
change
fix the problem of : 'this.stickyParent' might be 'null'
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
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 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()'
* Add demo to sticky-header
* revert
* deleted HEAD file
* removed unused 'id'
* changed class name to a more meaningful name
* removed unused CSS
* You have lots of duplicate of -webkit-appearance: none;padding: 20px;. Merge them into one
* nit
* nit: use header-style and header-color1
* very nit: add some different text so we can see the changes?
* fix according to comments in pr
* fix white space between different <div>s
* P -> p
@angular-automatic-lock-bot

Copy link
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 6, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yesPR author has agreed to Google's Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@sllethe@jelbourn@tinayuangao@andrewseguin@googlebot