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

Binding the swipe-pages to an array, use of templates inside swipe-pages #8

Open
FairozAhamed opened this issue Nov 10, 2014 · 5 comments
Assignees
Milestone

Comments

@FairozAhamed
Copy link

I have tried different approaches to get this to work. It would be great if I could generate the swipe-page automatically by binding rather that to declare them. Then I could have a swipe-page of controls that can be modified dynamically.

http://stackoverflow.com/questions/26826375/attribute-binding-to-polymer-template-in-swipe-pages

I am not sure if this is an issue, but surely a good thing to have.

@FairozAhamed FairozAhamed changed the title Binding the swipe-pages to an array, use of templaes inside swipe-pages Binding the swipe-pages to an array, use of templates inside swipe-pages Nov 10, 2014
@TheSeamau5 TheSeamau5 self-assigned this Nov 10, 2014
@TheSeamau5 TheSeamau5 added this to the v0.3 milestone Nov 10, 2014
@TheSeamau5
Copy link
Owner

This looks like a good thing to have. I haven't considered the case of what happens if you don't know how many pages there are beforehand (let alone if you can add or remove pages dynamically).

Currently, the swipe-pages element only works if you know exactly how many pages you have and just write them out in html. But this seems like a common use case so I'll make sure this feature will be ready by the next release.

Thanks for pointing this out.

@FairozAhamed
Copy link
Author

Turns out it does work. The code is up at SO. I had made the modification you suggested and initialised the array that was used in the attributes which I had missed.
And may I suggest a feature to make the swipe-pages go full screen? Something like, http://wowslider.com/ which can adapt to screen types. Then this component will have a much wider use. I am new to polymer, but perhaps it can be done by working with core-animated-pages?

@TheSeamau5
Copy link
Owner

Hmmm... i'll think about the full-screen thing. For the moment, I intend for this element to be sort of like a primitive you can build on top of and it basically is good at doing one thing and one thing only, have pages and allow you to swipe between them.

You could then totally overlay a button and then say something like

button.addEventListener("click", function(){
  pages.requestFullscreen();
}, false);

And then you could just style the fullscreen mode in CSS. It's really easy to do and it's all detailed in this article on HTML5 rocks.

In the meantime, I'll keep this issue open until I fix the few new problems I've noticed thanks to your example.

So, thanks for your help

@TheSeamau5
Copy link
Owner

If you want a really simple example of how to make stuff fullscreen and how to style them, here's a codepen I just made to illustrate. So, you can use this trick in your own element that extends swipe-pages and ta-dah, you have fullscreenable swipeable carousels!

@FairozAhamed
Copy link
Author

Thanks for the clear direction, really appreciate that!

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

No branches or pull requests

2 participants