nativescript-bottom-navigation
Version:
NativeScript plugin to add a bottom navigation component for Android & iOS
31 lines • 1.42 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var BottomNavigationBarDelegate = (function (_super) {
__extends(BottomNavigationBarDelegate, _super);
function BottomNavigationBarDelegate() {
return _super !== null && _super.apply(this, arguments) || this;
}
BottomNavigationBarDelegate.initWithOwner = function (owner) {
var delegate = (BottomNavigationBarDelegate.new());
delegate._owner = owner.get();
return delegate;
};
BottomNavigationBarDelegate.prototype.bottomNavigationBarDidSelectItem = function (navigationBar, item) {
if (this._owner.selectedTabIndex === item.tag) {
this._owner._emitTabReselected(item.tag);
return;
}
this._owner._emitTabSelected(item.tag);
};
BottomNavigationBarDelegate.prototype.bottomNavigationBarShouldSelectItem = function (bottomNavigationBar, item) {
var bottomNavigationTab = this._owner.items[item.tag];
if (!bottomNavigationTab.isSelectable) {
this._owner._emitTabPressed(item.tag);
}
return bottomNavigationTab.isSelectable;
};
BottomNavigationBarDelegate.ObjCProtocols = [MDCBottomNavigationBarDelegate];
return BottomNavigationBarDelegate;
}(NSObject));
exports.BottomNavigationBarDelegate = BottomNavigationBarDelegate;
//# sourceMappingURL=bottom-navigation-bar.delegate.js.map
;