FokkeZB / nl.fokkezb.loading

The widget provides a simple loading mask that can be easily styled and configured.
93 stars 18 forks source link

Now Showing when opening a new view or window #37

Closed macazaga closed 8 years ago

macazaga commented 8 years ago

Hi

Im using the kr.yostudio.drawer widget to draw a menu. When i call your widget through a new view or window the wigdet appears but on the main window and not the new one. I also tried adding the code directly into the .js file of that view but keeps showing on the main window.

var myLoading = Alloy.createWidget('nl.fokkezb.loading', 'window');
myLoading.show();

I also tried doing something like this:

$.newview.addEventListener('focus', function(){
    var myLoading = Alloy.createWidget('nl.fokkezb.loading', 'view');
});

and after that: myLoading.show('Loading');

and i get an error: Exception occurred at undefined:301: Uncaught ReferenceError: myLoading is not defined

Do you have any ideas how can i solve this?

Appreciate your help and time.

Rodrigo

FokkeZB commented 8 years ago

Hi @macazaga,

I haven't used kr.yostudio.drawer myself but it could well be that opening a stand-alone window over the drawer is not possible. In this case, you'd need to create the loading widget as a view in the window/view currently opened in the drawer.

The other error is simply because you define the variable within the scope of a self executing function, but try to use it outside of it.