Skip to content
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

Allow to set position for the pagination component #332

Merged
merged 4 commits into from
Dec 5, 2018

Conversation

am
Copy link
Contributor

@am am commented Nov 29, 2018

Description

Add the option to position the pagination component in relation to the images

Motivation and Context

Position:
At the moment the pagination has a fixed position at the bottom, in some cases, it would be helpful to be able to change this. The main options would be position on top or bottom of the images.

Overlay:
In some cases vertical spacing is critical, and the pagination component does takes it's part. Although we can turn it off, making this component just a hint that overlays the images can solve the issue in a simple way.

How Has This Been Tested?

All commands below ran without error.

yarn install
yarn build
yarn dev
yarn dev:build
yarn docs:build
yarn precommit
yarn test-coverage
yarn updateDocAssets

Screenshots:

screen shot 2018-11-29 at 08 16 06

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have included a vue-play example (if this is a new feature)

@am am changed the title feat(config): allow to overlay pagination component Allow to overlay pagination component Nov 29, 2018
@quinnlangille
Copy link
Member

Hey @am, this is great! It seems like this will resolve #298.

We also have a feature request for moving dots above the slides (#313). The implementation would be very similar to this. Would you be interested in making the modifications to include this functionality?

If not, totally ok, just thought it would be a cool update :octocat:

@am
Copy link
Contributor Author

am commented Nov 29, 2018

Hi @quinnlangille , thanks for the heads-up.

Matter of fact I got to start working on this one after seeing the #313 issue. I was misled by the issue since I thought the OP meant to place the pagination overlaying the image, only then, after reading carefully the issue I realized that it was a different request. Since overlaying the pagination was what I needed I went for it first.

I think this could be tackled by two different PR's. I do see the relation at implementation level, but from a user/configuration level splitting is preferred:

  • paginationOverlay: Boolean (true/false) Overlays the pagination over the images
  • paginationPosition: String ('top', 'bottom', 'top-bottom') Defines the position of the pagination in relation to the images.

Anyway, I can start working on the position feature. What are your thoughts? Two PR's or do you prefer to have a single one?

@quinnlangille
Copy link
Member

On the implementation level, I was thinking of having one prop that takes a value for all three

pagniationPosition which accepts top, bottom, or overlay, the latter enabling what is currently included in this feature.

What do you think?

@am
Copy link
Contributor Author

am commented Nov 29, 2018

@quinnlangille I like it! Trying to clarify, on #313 there are 3 options: top, bottom, and top-bottom, where the last does look to be a bit awkward as I never saw a case where there the pagination is duplicated. For the sake of simplicity, I would prefer to keep only one instance of the pagination component, but it's not what the OP askes.

In any case, I would give the following options to be able to cover the entire y axis:

  • top
  • bottom
  • top-overlay
  • bottom-overlay

@am am force-pushed the feature/pagination-overlay branch from 8e6008b to 6a8cd38 Compare November 29, 2018 21:42
@am
Copy link
Contributor Author

am commented Nov 29, 2018

@quinnlangille I've pushed another commit that does what I've described. It's open to discussion, please let me know your thoughts.

@am am changed the title Allow to overlay pagination component Allow to set position for the pagination component Nov 29, 2018
@josephting
Copy link
Contributor

This is really slick. I like it. I agree with @am about having duplicated pagination.

The original issue #313 had was the pagination being pushed below the fold so I think this will address this specific issue by having option to set pagination to the top so it'll be above the fold.

However, I'm kind of reluctant to add duplicated pagination as well. Perhaps enabling navigation instead is what we can suggest the OP to do.

@quinnlangille
Copy link
Member

Yeah I agree @am @josephting, we definitely don't want the duplicated pagination. Atleast, not as a part of this feature! I'll pull and test the changes in the morning, but gave a quick look and code looks good - nice work!

@@ -221,6 +221,13 @@ The fill color of pagination dots. Any valid CSS color is accepted.
* **Type**: `String`
* **Default**: `#efefef`

### paginationPosition

The position of pagination dots. Possible values are 'top', 'top-overlay', 'bottom-overlay'.
Copy link
Contributor

Choose a reason for hiding this comment

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

A little nitpick but "bottom" should be a possible value

Copy link
Contributor

@ashleysimpson ashleysimpson Dec 4, 2018

Choose a reason for hiding this comment

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

Weird, the reply feature doesn't reply to the message but adds a comment in the PR. Anyway, it's not a big deal. I know it's a default, I just personally like to add all the cases for completeness 😛

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, one thing I will mention is that you are missing the docs in the README.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ashleysimpson thanks for the feedback! It was my first attempt to reply using email (and probably my last seeing the limitations it has).

So regarding your comments, to be honest, I have no opinion about that and I prefer to do what best matches the project. I'll be adding a commit ASAP.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good! And thanks for the contribution 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Np. I've added a commit that should cover your feedback. Please let me know if something is missing.

Thank you

@am
Copy link
Contributor Author

am commented Dec 4, 2018 via email

@quinnlangille
Copy link
Member

Perfect, looks great! I'll merge into our working brand 0.17.0 and it will be released with the next minor 🚀

@quinnlangille quinnlangille changed the base branch from master to v0.17.0 December 5, 2018 21:27
@quinnlangille quinnlangille merged commit 78f2bbb into SSENSE:v0.17.0 Dec 5, 2018
quinnlangille pushed a commit that referenced this pull request Dec 19, 2018
* feat(config): allow to overlay pagination component

* feat(config): allow to set the pagination position

* docs(config): add pagination position

* docs(): improve paginationPosition description and add to README
quinnlangille pushed a commit that referenced this pull request Dec 27, 2018
* feat(config): allow to overlay pagination component

* feat(config): allow to set the pagination position

* docs(config): add pagination position

* docs(): improve paginationPosition description and add to README
@FrankyBoy
Copy link

So, what ever happened to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants