(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.baseClass = "navigator";
// Specify a different name to make the subclass available as a new widget instead of overwriting the baseclass:
exports.name = "limited-stack-navigator";
exports.constructor = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
exports.prototype = {};
exports.prototype.handleNavigateEvent = function(event) {
/*event = $tw.hooks.invokeHook("th-navigating",event);
if(event.navigateTo) {
this.addToStory(event.navigateTo,event.navigateFromTitle);
if(!event.navigateSuppressNavigation) {
this.addToHistory(event.navigateTo,event.navigateFromClientRect);
}
}*/
console.log("HANDLE");
return false;
};
})();
I get the following error:
"this.eventListeners is undefined". It seems that the constructor of widget (the baseclass of navigator) is not called beforehand (which registers
this.eventListeners
). So my basic questions here are:
- is this a design flaw? (e.g. the registration for the events inside of the navigator-constructor is a bad idea ;) )
- is it not intended to subclass navigator from some reason?
- am i doing something else (more trivial) wrong in my overwrite-trial above?
Thanks for your help,
Mirko