-
Notifications
You must be signed in to change notification settings - Fork 101
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
Pushstates / render content #160
Comments
Ok, got rendering pages on one place without affecting riot pages D: Ill do more testing and will upload to my fork. Hope to hear some critics x) I messed up and mixed both changes together. one formatting and the actual change :( sorry. @qathom Do you prefer if(somecondition) or if (somecondition) . Note the space after if and ( Another thing: Is it your editor that does not align the lines that should be, or you doing it by hand? Check here: andreujuanc@c04c8b5#diff-712364b0c799cdedfacfb35b259a3fafL516 |
Hi @andreujuanc, Thank you for your contributions! :) Implement html pushstates? Implement some sort of "render on id" instead of declaring all the pages on html? It'd be useful for those pages that are lazy loaded. Do you prefer if(somecondition) or if (somecondition) . Note the space after if and ( Problem with indentation Concerning |
@qathom Sorry for the delay! Lots of work. Seriously, i just did a demo for ionic, and it failed with the blank template xD Page nodes contained in the index.html file are considered like web pages (known resources). I think that lazy loaded data must be included inside of them. What do you think? Concerning renderOn: it can be an optional parameter. I am not sure to understand its purpose, is it for rendering the page content in another node than the main one contained in index.html? Both of those were kinda the same thing. one month ago or so I did this: I know its lots of "changes" but it was because of the formatting. I messed up and not only commited the big change, but also formatting , and now its hard to see. What i did was this: (in pizza app)
On app.js The thing is that in this demo pagethree is not defined in index.html, but on the other side, you can see there is a div with id=maincontent. and in the js the page is configured to render there via renderOn. So, the idea is to prevent double declaration of pages. I did some testing and it works fine. Need to update my branch to latest, but still seems to work fine. Let me know what you think, maybe it goes out of the "Ideals" of what your project is about. Cheers mate! |
Hi again @andreujuanc ;) As always, thank you for your contributions and work! <mypage data-page="true">[page content is added here]</mypage>
<mypage data-page="true">
<header></header>
<div class="content">
<div class="my-data">[page content is added here]</div>
</div>
</mypage> Did I miss something? |
More or less ! Lets say i have 20 pages, i would have to add 20 pages tags and also would need to make the reference in javascript before init() right? So my idea was to allow pages to be rendered by phonon on a certain element marked by an ID. That way I would have , in my personal case, 20 pages like this:
And just one element to render on:
Probably this wont let you have transition animations and other stuff i haven't thought about. or would require more work to get them right. Also would make this hard to cache. But there is one benefit from this, each page would be created only in js, and this would be completely optional for those who have projects with too many pages. For a nice compact app, having pages as tags its nice and fast, but if you have a team and there are lots of pages, then without this it would need to double check everything. |
Hi @andreujuanc, Okay I see! Thank you for your explanation. |
Yea, more or less.
I don't know which one would have better performance. What do you think? |
I think that |
This is a great idea, man I needed create an app and this feature would have been very useful. |
Hello!!
Back to work after some vacations x)
First, wanted to give you feedback about the "page" injection on every page. Is great, works. I changed the ractive demo pagetwo.html to implement this option instead of doing it on app.js and worked on first try.
Back to the real topic, do you have any plans to:
app.js:
app.on({page: 'home', renderon: 'maincontent'});
index.html:
<div id='maincontent'></div>
If there is already a way to do this, I missed it D:
Also, if this goes "against" the project ideals, it's ok, I wont cry. Maybe.
Cheers
UPDATE:
I think second idea can be implemented in getPageEl function. Instead of returning the element with the same tag name as the page, it can return the element in where it will be rendered.
The text was updated successfully, but these errors were encountered: