Issue when using loadingmask

Daniel G, modified 6 Years ago. Regular Member Posts: 141 Join Date: 3/14/17 Recent Posts
Hi.

I was facing an issue due to permissions in a portlet. I trying to add to a form the loadingmask. I am able to do it for admin users but when the user is a guest, it fails:


<script type="text/javascript" charset="utf-8">
 function <portlet:namespace />showLoading() {


AUI().use( 'aui-loading-mask', function(A){
    

        A.one('#<portlet:namespace />reportForm').plug(A.LoadingMask, { background: '#000' });
        A.one('#<portlet:namespace />reportForm').loadingmask.toggle();
    });

 }
</script>






It is like the plug function does not work for guest users because loadingmask is always undefined for them:


Uncaught TypeError: Cannot read property 'toggle' of undefined


Could anyone help me with this? Any idea would be very appreciated.

Thanks in advance.


Kind regards.