Skip to content

Commit

Permalink
fix(ios): implement Ti.UI.Tab.setWindow() in JS to avoid error
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Apr 8, 2021
1 parent feb5c43 commit 2185a8f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion common/Resources/ti.internal/extensions/ti/ui/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* globals OS_ANDROID */
/* globals OS_ANDROID, OS_IOS */
if (OS_ANDROID) {
const Tab = Titanium.UI.Tab;

Expand Down Expand Up @@ -48,6 +48,7 @@ if (OS_ANDROID) {
_setWindow.call(this, window);
};

// TODO: Remove! This is an undocumented accessor method
Tab.prototype.getWindow = function () {
return this._window;
};
Expand All @@ -57,4 +58,10 @@ if (OS_ANDROID) {
set: Tab.prototype.setWindow,
get: Tab.prototype.getWindow
});
} else if (OS_IOS) {
const tab = Titanium.UI.createTab();
const TabPrototype = Object.getPrototypeOf(tab);
TabPrototype.setWindow = function (window) {
this.window = window; // forward to setting property
};
}

0 comments on commit 2185a8f

Please sign in to comment.