Commit 44c1209a authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

QfqPage.js: do not expect page having tabs.

parent 474593a7
...@@ -23,14 +23,8 @@ if (!QfqNS) { ...@@ -23,14 +23,8 @@ if (!QfqNS) {
}, settings }, settings
); );
this.bsTabs = new QfqNS.BSTabs(this.settings.tabsId);
try { try {
this.qfqForm = new QfqNS.QfqForm(this.settings.formId, this.settings.submitTo, this.settings.deleteUrl); this.bsTabs = new QfqNS.BSTabs(this.settings.tabsId);
this.qfqForm.setBsTabs(this.bsTabs);
} catch (e) {
QfqNS.Log.error(e.message);
this.qfqForm = null;
}
var currentState = this.settings.pageState.getPageState(); var currentState = this.settings.pageState.getPageState();
if (currentState !== "") { if (currentState !== "") {
...@@ -40,8 +34,21 @@ if (!QfqNS) { ...@@ -40,8 +34,21 @@ if (!QfqNS) {
this.settings.pageState.setPageState(this.bsTabs.getCurrentTab(), QfqNS.PageTitle.get()); this.settings.pageState.setPageState(this.bsTabs.getCurrentTab(), QfqNS.PageTitle.get());
} }
this.bsTabs.addTabShowHandler(this.tabShowHandler.bind(this)); this.bsTabs.addTabShowHandler(this.tabShowHandler.bind(this));
this.settings.pageState.addStateActivationHandler(this.popStateHandler.bind(this)); this.settings.pageState.addStateActivationHandler(this.popStateHandler.bind(this));
} catch (e) {
QfqNS.Log.message(e.message);
this.bsTabs = null;
}
try {
this.qfqForm = new QfqNS.QfqForm(this.settings.formId, this.settings.submitTo, this.settings.deleteUrl);
this.qfqForm.setBsTabs(this.bsTabs);
} catch (e) {
QfqNS.Log.error(e.message);
this.qfqForm = null;
}
}; };
n.QfqPage.prototype.tabShowHandler = function (bsTabs) { n.QfqPage.prototype.tabShowHandler = function (bsTabs) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment