-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqst.js
35 lines (34 loc) · 1.08 KB
/
qst.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
*/
jQuery(function($) {
$(document).ready(function() {
var metadoc = new Qst.MetaFormModel();
var actmodel = new Qst.ActForm();
var actview = new Qst.ActFormView({
model: actmodel
});
var actmodel_old = new Qst.ActForm();
actview.inprogressView.ajaxcall(
metadoc.fetch.bind(metadoc),
function(bSuccess, data, jqXHR) {
actmodel.metaupdated(this);
actview.type = metadoc.get('viewtype');
/* no longer support 'bring previous answer' feature. */
// actview.inprogressView.ajaxcall(
// actmodel_old.fetch.bind(actmodel_old),
// function (bSuccess, data, jqXHR) {
// if (this.itemlist().length === 0) {
// // if no answer data exists, get metamodel to setup questionnaire form.
// } else {
// actmodel.copy_answer(actmodel_old);
// }
// }.bind(actmodel_old),
// {timeout: qstnr_data.ajaxTimeout}
// );
actview.render();
}.bind(metadoc), {
timeout: qstnr_data.ajaxTimeout
}
);
});
});