Languages

Menu
Sites
Language
What does this code do?

Hello,

As my subject title said, I would like to know what does this code do (into the SAGalleryConsumer sample):

(function(ui) {
    var closePopup = ui.closePopup.bind(ui);
	var toastPopup = document.getElementById('popupToast');
	toastPopup.addEventListener('popupshow', function(ev){
		setTimeout(closePopup, 3000);
	}, false);
})(window.gear.ui);

Thank you in advance!

Responses

2 Replies
Marco Buettner

It close the popup with id "popupToast" after 3 seconds.

AVSukhov

Hello,

This code closes the popup after 3 seconds after its opening.
This is similar to the behavior of the toast in android