@titanium/turbo
Version:
<p align="center"> <img src="https://cdn.secure-api.org/images/turbo-title_400.png" /><br> <a href="https://www.npmjs.com/package/@titanium/turbo"> <img src="https://img.shields.io/npm/v/@titanium/turbo.png" /> </a> </p>
12 lines (11 loc) • 468 B
JavaScript
function <%= openFunc %>() {
<%= parent %>.removeEventListener('open', <%= openFunc %>);
if (<%= parent %>.activity) {
<%= code %>
} else {
Ti.API.warn('You attempted to access an Activity on a lightweight Window or other');
Ti.API.warn('UI component which does not have an Android activity. Android Activities');
Ti.API.warn('are valid with only windows in TabGroups or heavyweight Windows.');
}
}
<%= parent %>.addEventListener('open', <%= openFunc %>);