Skip to content

Commit

Permalink
feat: Add dotsPosition option, closes #211
Browse files Browse the repository at this point in the history
  • Loading branch information
MurhafSousli committed Nov 17, 2018
1 parent e2e58b6 commit 263d297
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/core/src/lib/components/gallery-core.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ export class GalleryCoreComponent {
return this.config.imageSize;
}

}
/** Set gallery dots position */
@HostBinding('attr.dotsPosition') get dotsPosition(): 'top' | 'bottom' {
return this.config.dotsPosition;
}
1 change: 1 addition & 0 deletions projects/core/src/lib/models/config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GalleryConfig {
thumbTemplate?: TemplateRef<any>;
thumbMode?: 'strict' | 'free';
imageSize?: 'cover' | 'contain';
dotsPosition?: 'top' | 'bottom';
slidingDirection?: 'horizontal' | 'vertical';
loadingStrategy?: 'preload' | 'lazy' | 'default';
thumbPosition?: 'top' | 'left' | 'right' | 'bottom';
Expand Down
6 changes: 6 additions & 0 deletions projects/core/src/lib/styles/dots.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
::ng-deep {
gallery-core[dotsPosition='top'] gallery-dots {
top: 0;
}
gallery-core[dotsPosition='bottom'] gallery-dots {
bottom: 0;
}
gallery-dots {
display: flex;
justify-content: center;
Expand Down
1 change: 1 addition & 0 deletions projects/core/src/lib/utils/gallery.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const defaultConfig: GalleryConfig = {
panSensitivity: 25,
disableThumb: false,
playerInterval: 3000,
dotsPosition: 'bottom',
imageSize: ImageSize.Contain,
thumbMode: ThumbnailsMode.Strict,
thumbPosition: ThumbnailsPosition.Bottom,
Expand Down

0 comments on commit 263d297

Please sign in to comment.