Page 6 of 11

Facebook Style Navigation

Posted: Tue Jul 23, 2013 8:46 pm
by RicardoP

Would be possible to have the person that wrote the above work around function (posted by Katya) look at their code and fix the event handling piece so we don't have to hard code all events in JavaScript?
That would give us (customers) a lot Sarisfaction.

All the best,

Ricardo


Facebook Style Navigation

Posted: Tue Jul 23, 2013 8:49 pm
by Maryna Brodina

Sorry, I don't think it's possible. At least in the nearest future.


Facebook Style Navigation

Posted: Thu Aug 08, 2013 8:07 am
by mollyfud

Hi Guys,
I have the same issue with adding events. I see that at the moment you probably have to add it in the Javascript code and that would be fine. Can someone complete this post by showing how/where to add that code?

For bonus points, is there a way to do this once, and have it called over and over again from every page (hard coded javascript maybe)?

I do love this though, great work!


Facebook Style Navigation

Posted: Thu Aug 08, 2013 9:34 am
by Anton Artyukh5836028

Hello,

Here is the link to the new version of this function which supports many pages.

We propose you to place the Grid component on the page and leave there an only cell. Grid is a container for the menu. Next you need to place in the single cell all the right buttons and menus, you can simply add actions to them. Besides, the mapping continues working with such menu!

Then, on Page Show event for FIRST page add Run JavaScript action with the following code:

precode// we need init panel only ONCE for first screen
if ( window.awesomeMenu == undefined) {
window.awesomeMenu = SlideMenu( Appery("mobilegrid_80"), Appery("mobilecontainer1") );
}/code/pre

Where mobilegrid_80 is the grid with one cell. Also it's important to pass page container (mobilecontainer1).

That is, the first parameter describes the menu container, the second is needed to determine page container.

The function takes three additional parameters:

  • side of the menu is displayed (by default, on the left) - the string "left" or "right";

  • type of appearance;

  • Theme Swatch.

    Read more here.

    Your menu is ready to call. You can add button to a header and add the following JavaScript on Click event:

    precodewindow.awesomeMenu.panel("open");/code/pre

    For the second and following pages where you need to use menu.

    It's better to hide menu container with "Visible" flag. Otherwise it blinks when page appears.

    For the second page add Page Show event with the following code:

    precodewindow.awesomeMenu2 = SlideMenu( Appery("mobilegrid_2"), Appery( "mobilecontainer2" ), "right" );
    Appery("mobilegrid_2").css({display: "table"});/code/pre

    You needs to control naming for mobilecontainer and grids.

    Please note that there is no code to check if menu exists and variable name is different.

    And next -- there is no normal way to hardcode menu for all screens. Theoretically this can be done with flag "Render all pages in one HTML file". But we don't test this.


Facebook Style Navigation

Posted: Thu Aug 08, 2013 1:13 pm
by mollyfud

Thanks for this. I am not sure if I am doing something wrong but the events of the items in the slidepanel work on the second page but not on the first one.

Any ideas? No errors in the JS console or anything, just buttons from the grid (which do show up fine) don't do anything.


Facebook Style Navigation

Posted: Thu Aug 08, 2013 1:16 pm
by Anton Artyukh5836028

Please check your code for Page Show events on both pages.


Facebook Style Navigation

Posted: Fri Aug 09, 2013 12:38 am
by mollyfud

Thanks! My bad. Think I had a capitalization issue with the container name that was stopping the events (Hope this helps others).

Also, I think I am right (worked in my testing anyway) that the grid can be any grid, with any number of cells you want if it gives you the look your after!

This is great! I would imagine many would love this! Any thought of:
a) Making it part of the product as a widget/template?
b) Making this a tutorial or something?

Thanks again!


Facebook Style Navigation

Posted: Fri Aug 09, 2013 5:41 am
by Kateryna Grynko

Hello!

Thank you. We will promote your proposal to our dev team.


Facebook Style Navigation

Posted: Fri Aug 16, 2013 11:39 am
by dudi peretz

Hi Katya,
Can u send me the backup file of thr example project ?


Facebook Style Navigation

Posted: Fri Aug 16, 2013 12:04 pm
by Maryna Brodina

Done, please check your mail box.