jaunesarmiento / fries

Fries helps you prototype Android apps using HTML, CSS, and JavaScript.
MIT License
1.55k stars 222 forks source link

Action-overflow spinner doesn't work after stack.js transition #60

Closed EltonZhang13 closed 11 years ago

EltonZhang13 commented 11 years ago

After using Stack.js data-transition="push", spinners in the action bar can't be executed. I get an "Uncaught TypeError: Cannot read property 'classlist' of undefined spinner.js:43" when I attempt to press on the toggle-spinner.

jaunesarmiento commented 11 years ago

Hi @EltonZhang13, what version of Fries are you using? Because I'm pretty sure that this was fixed on wip-1.0.1 branch.

EltonZhang13 commented 11 years ago

Hmm, must've been from the master branch. Thanks for the reply. I'm gonna update you on my situation; hopefully, you'll still reply.

EltonZhang13 commented 11 years ago

Could you explain to me why the error occurred? In other words, what changed in the code fixed the error.

EltonZhang13 commented 11 years ago

Could you explain to me why the error occurred? In other words, what changed in the code that fixed the error.

jaunesarmiento commented 11 years ago

Sure thing. The problem was that in the master branch, the action overflows aren't re-initialized when the push event is called. If you check action-bars.js in wip-1.0.1 branch, you'll see the following line:

window.addEventListener('push', checkActionOverflow, false);

That line handles the reinitialization of the action overflows when a page is pushed onto the history stack. :)

Hope that clears things up for you.

EltonZhang13 commented 11 years ago

It does, thanks for that. Another thing that you might have fixed (but I'm just to dumb to find by myself) is that Stack.js transitions into another html page don't allow for js specific to that page to be run.

jaunesarmiento commented 11 years ago

No problem bud. :) Glad to help.