pebble.js blank page when back is pressed - javascript

i wrote a pebble.js app, basically it shows a splash screen and a menu showing bus stops. when the user press select button on a menu item a "card" is showed with the arrival info.
however, sometimes menu items are not showed correctly (some menu items disappearing) and when i press back in the menu screen instead of closing the app a blank "page" is showed.
i dont know what i'm doing wrong. i was thinking of memory leaks but honestly i dont know...
heres the source in case someone kind wants to help me : http://pastebin.com/92xbVs2F

This is now fixed in Pebble.js. Your app is magically fixed as well since it was pushed to CloudPebble.
If you'd like to know the technical details, it's because Menu Layer in the C API is normally not allowed to override the back button. As a work around, Pebble.js is currently using a blank window to catch the back button, but this hack only works if the menu is not the root window of your application. The fixed version no longer uses a blank window to catch the back button and overrides the back button in an obtuse way.

Related

"Go back" button issue in google chrome

I have a bit of a head scratcher here. My project has a main page in which some transitions happen and some buttons appear. Clicking those buttons allow you to navigate the site. So far so good. On those lets say "secondary" pages I have a series of "back" buttons that take you back to the main page with the following link:
<p class="backContact">BACK</p>
Now, this is where it gets specific. When I return on to the main page, I want to return to the main page that's "cached" so basically the main page AFTER the said animations and buttons appear, not back to the page as if I just had come on the website for the first time. Same for when you hit the back arrow on the browser itself.
The code I just posted with the link was doing just that and it works fine in safari and firefox. BUT in chrome the behaviour is different and when the back button is clicked it goes back to the main page before all the animations happen which is really annoying as I just want them to play the first time round else they become tiresome.
Is there anyway to force chrome to come back to the "cached" previous page? Many thanks

What is happening after dismissing alert and how to simulate it?

I have this strange issue with web app I am working on. Basically there is a UI error, that after pulling menu from the side and closing it again, the whole DOM is moved half off the screen.
The interesting part is that if I call alert(); after the menu slides out again, something happens with the view and page is displayed correctly again.
I have tried to re-render dom by hiding it and showing again, but it doesnt have the same effect.
Does anyone know what happens when alert window is displayed/closed and if there is any way to simulate it in JS?
Thanks
UPDATE: Just so you can see I didn't make that up: https://github.com/jakiestfu/Snap.js/issues/238

What method should I use to make a Chrome toolbar?

I have this small toolbar-like html page:
Currently, a user clicks on a link and this page opens in a new tab at the size shown. The user places this at the top of their screen then opens another tab below it taking up the rest of their screen. The user mainly works out of the larger window and interacts with this "toolbar" periodically.
This setup is obviously not ideal. Especially since you cant hide the chrome frame or the address bar which make the toolbar twice the height it needs to be.
What I'd like to do is make this an actual tool bar in Chrome, something like:
I did see How to make a toolbar in Google Chrome? but I'm not sure which method would best suit my needs.
A few details:
The toolbar must remain visible anytime its turned on/opened (as I
understand it 'infobars' close themselves when not active? not 100%
on that though)
Navigating to a new page should not close the bar
Navigating to a new page should not reload / render the bar (as I understand it using content scripts would reload the bar every time the user goes to a new page,)
I guess we could use a content scripts / local storage type solution to render the bar then set it up as it was on the previous page, seems hacky though.
Am I missing a better way to do this?
Could anyone help me get started down the right path to achieve this result?
A toolbar is an extension.
use content script. The easiet way would be to download a sample from official google chrome's developper site.. and you will be able to change it the way you want.

Setting focus of a screen reader on a modal alert in ember

I am attempting to make my ember.js app more accessible and am doing my testing via Apple's built-in VoiceOver utility. I'm adding ariaRoles as necessary to my views and tacking on aria-label attributes where the purpose of navigation is unclear. I'm having issues getting the focus on modal alerts, as the reader's focus stays on the page items behind the modal. Does anyone have experience handling focus on modal alerts for screen readers? I'm under the impression that declaring "ariaRole:'alertDialog'" in my view sets the appropriate role for such a dialog, and it is possible that the focus behavior for this role differs between screen readers. Thanks!!!
I don't have first hand experience with modal stuff. Essentially your issue is you are throwing on an ARIA role, and kind of expect it to work. You need to do more than that. You need to keep the following in mind:
Once the link/button is pressed, move focus to the modal window/dialog/popup. Most modal elements are simply a <div>. You can give the<div> an attribute of tabindex="-1".
Trap focus inside the modal window.
Allow the user to press escape to close
When closed, move focus back to link/button
Resources
keyboard accessibility with lightboxes
Similar question at UX StackExchange
Demo modal dialog - I think this is still under dev (I haven't heard from the author for a while).
jQuery Google Group thread
(Hans is the top guy or one of, for this stuff)

Appcelerator. Change content of window

I am developing an iOS app in Appcelerator.
I got four tabs. How can I change the content of the window when the user clicks a special button or navbar title?
For example if the tab_1 is set to open window_1.js in app.js how can I open window_2.js in tab_1 upon button click? I would prefer not to use views since I would like the content of the window to be in seperate files.
Thankful for all input!
I ran into a similar road block the other day with a Titanium app I'm building. The Titanium.UI.TabGroup has a property called activeTab that is very helpful.
var my_other_view = Ti.UI.createView({params});
var my_tab_group = Ti.UI.createTabGroup({params});
my_tab_group.activeTab.open(my_other_view);
Of course, the code is significantly short-handed :) but it hopefully will steer you in the right direction so that you can implement the desired behavior in your app!
One of the cool thing (IMHO) about activeTab.open() is that, on iOS, a 'back' button will automatically be placed on the title bar so that the user can go back to the previous view/content.

Categories

Resources