ti.loader
ti.loader copied to clipboard
Loader not visible with modal window
Hi, the widget works great. Anyway, now I have a modal window, and what I can see is that if I do a
myWidgetObject.show("my message");
from the controller related to this modal window, the loader is not shown. If I close the modal window, I can see that the loader is there, so it's just behind the modal window. Any hints?
Thanks
The widget is a normal window (non-modal), so, by definition, you can't open a non-modal window over a modal window.
Try to override in your app.tss
:
"#cfn_LoaderMask": {
modal: true
}
And let us know if this works and this solution doesn't cause unexpected behaviors.
Ok thanks,
I see. Anyway, I've tried your suggested solution (both with id and class), but the loader is still behind the other modal window. I've tried even to play with zIndex but I've read in other threads that it's not supported by Window elements.
Do you have any other suggestion I can try?
Thanks
On Wed, Jul 29, 2015 at 1:16 PM, Flavio Maria De Stefano < [email protected]> wrote:
The widget is a normal window (non-modal), so, by definition, you can't open a non-modal window over a modal window.
Try to override in your app.tss:
"#cfn_LoaderMask": { modal: true }
And let us know if this works and this solution doesn't cause unexpected behaviors.
— Reply to this email directly or view it on GitHub https://github.com/CaffeinaLab/Ti.Loader/issues/1#issuecomment-125921906 .
[email protected],[email protected] http://lorenzosfarra.com/ Twitter/Identi.ca account: lrnzsfr
What is the order to open the Windows?
Try to open first the window and once it is opened, the loader.
Yes I open the loader later. Here's what I have. I create the loader in alloy.js because I use it in different parts of my app:
Alloy.Globals.loader = Alloy.createWidget('com.caffeinalab.titanium.loader', {
message: "",
cancelable: false,
useImages: true
});
Now, inside my modal window defined in addProductToCart.js, when the user clicks a specific button (so, the window is clearly already opened), I simply do
Alloy.Globals.loader.show("my message here");
And in addProductToCart.tss I've tried to set your rule (by Id and by class, too). Anyway, just to try I've set even modal: true
directly in your window.tss file, without luck.
I can see your point, I was expecting the same: you open a new modal window -> it goes over the last one.
No luck for now,
thanks
[Update]
Maybe the rule in .tss is not enough, because if I force the code directly in your window.js with
$.cfn_LoaderMask.open({'modal': true});
The loader is shown.
So, for now I'm adding a custom parameter "modal" when I instantiate the widget and to open the loader accordingly. Anyway, the effect on a modal window is very ugly (black screen).
Yay, now I remember why we didn't use modal windows, for the "black screen" effect. On Monday I try to find a fix for this.
Thanks a lot for your support, hope to have good news soon. Lorenzo
Hi, unfortunately the bug of "black window" is relative to Titanium + iOS.
Modal windows can't have a semi-transparent background.
I tried an hack with backgroundColor: transparent
on the Window, but doesn't works anyway.
My suggestion is to not use modal window, they are really buggy... Can't you convert a modal window to a normal window?
Ouch, this is a problem for me. At the moment is not possible because of the structure of the section, it will take too much time to convert it at the moment. Thanks for your support, anyway.
Lorenzo
Are you sure?
Can't you just set modal: false
and set an high zIndex
?
It was one of the first thing that I tried but I had some issues, I will try again and in case I will report it, here. Thanks.