|
@@ -146,8 +146,7 @@ pageManager.prototype._mergeData = function () {
|
|
|
rectNo: -1,
|
|
|
isSubject: true,
|
|
|
cdelete: 0,
|
|
|
- minHeight: -1,
|
|
|
- content: null
|
|
|
+ minHeight: -1
|
|
|
};
|
|
|
for (let index in data) {
|
|
|
item = data[index];
|
|
@@ -248,17 +247,19 @@ pageManager.prototype._itemToPage = function (item) {
|
|
|
item.questions = questionsTemp;
|
|
|
domOption.height = holdHeight;
|
|
|
domOption.questions = cHoldQuestions;
|
|
|
- if (domOption.questions.length > 0) {
|
|
|
- item.height -= domOption.height;
|
|
|
- item.height < nextBoxHeight && (item.height = nextBoxHeight);
|
|
|
- this.currentPage.addDom(domOption);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (item.height > this.minHeight) {
|
|
|
domOption.isDrag = false;
|
|
|
} else {
|
|
|
domOption.isDrag = true;
|
|
|
}
|
|
|
+
|
|
|
+ if (domOption.questions.length > 0) {
|
|
|
+ item.height -= domOption.height;
|
|
|
+ item.height < nextBoxHeight && (item.height = nextBoxHeight);
|
|
|
+ this.currentPage.addDom(domOption);
|
|
|
+ }
|
|
|
// 如果有最小高度,则说明是刷新状态
|
|
|
if(item.minHeight) {
|
|
|
item.minHeight -= domOption.height;
|
|
@@ -268,10 +269,14 @@ pageManager.prototype._itemToPage = function (item) {
|
|
|
this.currentPage = null;
|
|
|
if (item.height > this.minHeight) {
|
|
|
// 如果有最小高度,则说明是刷新状态
|
|
|
- if(item.minHeight) {
|
|
|
- item.minHeight <= 0 && (item.cdelete = 1);
|
|
|
+ if (item.questions.length < 1) {
|
|
|
+ let lastQuestion = JSON.parse(JSON.stringify( domOption.questions[domOption.questions.length - 1] ));
|
|
|
+ lastQuestion.minHeight = item.height;
|
|
|
+ lastQuestion.isSubQuestion = true;
|
|
|
+ item.questions.push(lastQuestion);
|
|
|
}
|
|
|
|
|
|
+ item.minHeight <= 0 ? item.cdelete = 1 : item.cdelete = 0;
|
|
|
this._itemToPage(item);
|
|
|
}
|
|
|
} else {
|
|
@@ -334,11 +339,10 @@ pageManager.prototype._refreshPage = function () {
|
|
|
questions: doms[j].questions,
|
|
|
rectNo: doms[j].rectNo,
|
|
|
minHeight: doms[j].minHeight,
|
|
|
- content: doms[j].content
|
|
|
-
|
|
|
+ cdelete: 0
|
|
|
};
|
|
|
if(parseInt(item.rectNo) === nowRectNo) {
|
|
|
- data[(length-1)].questions.push.apply(data[(length-1)].questions, item.questions);
|
|
|
+ !item.questions[0].isSubQuestion && data[(length-1)].questions.push.apply(data[(length-1)].questions, item.questions);
|
|
|
data[(length-1)].height += item.height;
|
|
|
} else {
|
|
|
nowRectNo = parseInt(item.rectNo);
|