Skip to content

Commit

Permalink
issue-351 adapter pause/resume demo in the Adapter scope
Browse files Browse the repository at this point in the history
  • Loading branch information
dhilt committed Mar 3, 2024
1 parent 00660f4 commit 8586065
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 21 deletions.
6 changes: 3 additions & 3 deletions demo/app/demos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ import { DemoRemoveComponent } from './samples/adapter/remove.component';
import { DemoReplaceComponent } from './samples/adapter/replace.component';
import { DemoClipComponent } from './samples/adapter/clip.component';
import { DemoUpdateComponent } from './samples/adapter/update.component';
import { DemoPauseResumeComponent } from './samples/adapter/pause-resume.component';

import { DemoViewportElementSettingComponent } from './samples/experimental/viewportElement-setting.component';
import { DemoInverseSettingComponent } from './samples/experimental/inverse-setting.component';
import { DemoAdapterFixPositionComponent } from './samples/experimental/adapter-fix-position.component';
import { DemoAdapterFixUpdaterComponent } from './samples/experimental/adapter-fix-updater.component';
import { DemoAdapterFixScrollToItemComponent } from './samples/experimental/adapter-fix-scrollToItem.component';
import { DemoOnBeforeClipSettingComponent } from './samples/experimental/onBeforeClip-setting.component';
import { DemoAdapterPauseResumeComponent } from './samples/experimental/adapter-pause-resume.component';
import { DemoRoutinesComponent } from './samples/experimental/routines.component';

const common = [
Expand Down Expand Up @@ -91,7 +91,8 @@ const adapter = [
DemoRemoveComponent,
DemoReplaceComponent,
DemoClipComponent,
DemoUpdateComponent
DemoUpdateComponent,
DemoPauseResumeComponent
];

const experimental = [
Expand All @@ -101,7 +102,6 @@ const experimental = [
DemoAdapterFixUpdaterComponent,
DemoAdapterFixScrollToItemComponent,
DemoOnBeforeClipSettingComponent,
DemoAdapterPauseResumeComponent,
DemoRoutinesComponent
];

Expand Down
10 changes: 5 additions & 5 deletions demo/app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ const adapterMethodsScope = {
id: 'update',
name: 'Update',
scope: globalScope.adapterMethods.id
},
pauseResume: {
id: 'pause-resume',
name: 'Pause / resume',
scope: globalScope.adapterMethods.id
}
};

Expand Down Expand Up @@ -262,11 +267,6 @@ const experimentalScope = {
name: 'onBeforeClip setting',
scope: globalScope.experimental.id
},
adapterPauseResume: {
id: 'adapter-pause-resume',
name: 'Adapter pause/resume methods',
scope: globalScope.experimental.id
},
routines: {
id: 'routines',
name: 'Routines',
Expand Down
8 changes: 1 addition & 7 deletions demo/app/samples/adapter.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
<h1>Angular UI Scroll Adapter Demos</h1>

<p>
<em>Adapter</em> is&nbsp;a&nbsp;special object to&nbsp;assess and manipulate
the Scroller. The API it&nbsp;provides is&nbsp; discussed on&nbsp;this page.
In order to get an access to the <em>Adapter</em> API, the
<em>Datasource</em> has to be instantiated via operator <em>new</em>:
</p>

<pre>{{ datasourceSample }}</pre>

<p>
For better typings it is recommended to provide also data item type argument:
</p>

<pre>{{ datasourceTypedSample }}</pre>

<p>
The constructor argument is&nbsp;an&nbsp;object of&nbsp;<em>IDatasource</em>
type which must include <em>get</em> method property and may include
Expand All @@ -24,7 +19,6 @@ <h1>Angular UI Scroll Adapter Demos</h1>
we&nbsp;may access <em>this.datasource.adapter</em> property object with its
API methods and properties.
</p>

<app-demo-init></app-demo-init>
<app-demo-package-info></app-demo-package-info>
<app-demo-is-loading></app-demo-is-loading>
Expand All @@ -33,7 +27,6 @@ <h1>Angular UI Scroll Adapter Demos</h1>
<app-demo-buffer-info></app-demo-buffer-info>
<app-demo-bof-eof></app-demo-bof-eof>
<app-demo-first-last-visible-items></app-demo-first-last-visible-items>

<app-demo-adapter-return-value></app-demo-adapter-return-value>
<app-adapter-relax></app-adapter-relax>
<app-demo-reload></app-demo-reload>
Expand All @@ -46,3 +39,4 @@ <h1>Angular UI Scroll Adapter Demos</h1>
<app-demo-remove></app-demo-remove>
<app-demo-replace></app-demo-replace>
<app-demo-update></app-demo-update>
<app-demo-pause-resume></app-demo-pause-resume>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div description>
<p>
The <em>Adapter.pause</em> method is to stop the Scroller.
It doesn't receive the scroll events from the viewport,
When paused, it doesn't receive the scroll events from the viewport,
so the scroll events are ignored. Also, all the Adapter methods
(except <em>Adapter.resume</em> and <em>Adapter.reset</em>)
don't do anything.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { DemoSources, DemoSourceType, MyItem } from '../../shared/interfaces';
import { Datasource } from 'ngx-ui-scroll';

@Component({
selector: 'app-adapter-pause-resume',
templateUrl: './adapter-pause-resume.component.html'
selector: 'app-demo-pause-resume',
templateUrl: './pause-resume.component.html'
})
export class DemoAdapterPauseResumeComponent {
export class DemoPauseResumeComponent {
demoContext = {
config: demos.experimental.map.adapterPauseResume,
config: demos.adapterMethods.map.pauseResume,
noInfo: true
};

Expand Down
1 change: 0 additions & 1 deletion demo/app/samples/experimental.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ <h1>Angular UI Scroll Experimental Demos</h1>
<app-adapter-fix-updater></app-adapter-fix-updater>
<app-adapter-fix-scroll-to-item></app-adapter-fix-scroll-to-item>
<app-on-before-clip-setting></app-on-before-clip-setting>
<app-adapter-pause-resume></app-adapter-pause-resume>
<app-routines></app-routines>

0 comments on commit 8586065

Please sign in to comment.