|
@@ -277,11 +277,41 @@ yzPage.prototype = {
|
|
|
}
|
|
|
nextColumn.page._checkColumnOut(nextColumn.column);
|
|
|
// 跨栏符检测
|
|
|
- this._updateCrossColumn(nextColumn.column);
|
|
|
+ this._updateCrossColumn(nextColumn.column);
|
|
|
+ this._updateObjectColumnHeight(nextColumn.column[0]);
|
|
|
}
|
|
|
// 跨栏符检测
|
|
|
this._updateCrossColumn($column);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * function 更新客观题栏高
|
|
|
+ */
|
|
|
+ _updateObjectColumnHeight: function (checkColumn) {
|
|
|
+ let cententHeight = 0;
|
|
|
+ let contentIndex = 0;
|
|
|
+ let updateNextPara = this._cycleFindParagraph(checkColumn.firstChild);
|
|
|
+ if (updateNextPara) {
|
|
|
+ $(updateNextPara).find('.js-option-column').forEach(column => {
|
|
|
+ let contentSize = $(column.firstChild).getSizeData();
|
|
|
+ if (contentIndex === 0) {
|
|
|
+ cententHeight = contentSize.height;
|
|
|
+ }
|
|
|
+ $(column).css('min-height', cententHeight + 'px');
|
|
|
+ contentIndex++;
|
|
|
+ });
|
|
|
+ // 更新栏高 结束
|
|
|
+ let rowIndex = 0;
|
|
|
+ $(updateNextPara).find('.js-options-row').forEach(row => {
|
|
|
+ if (rowIndex > 0) {
|
|
|
+ $(row).css('border-top', '1px solid #000');
|
|
|
+ }
|
|
|
+ rowIndex++;
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* function 插入段落
|
|
@@ -329,10 +359,41 @@ yzPage.prototype = {
|
|
|
let nextBorderId = firstFirst.getAttribute('data-id');
|
|
|
if (borderId === nextBorderId) {
|
|
|
// 如果两个框是同一个框
|
|
|
- let insertLastQuestion = insertLast.firstChild.lastChild;
|
|
|
- let firstFirstQuestion = firstFirst.firstChild.firstChild;
|
|
|
- this._mergeSplitBorder(insertLastQuestion, firstFirstQuestion, $(insertLast));
|
|
|
- this._insertDomBeforeByFirst($Allparagraph, firstFirst);
|
|
|
+ let borderType = parseInt(firstFirst.getAttribute('data-type'));
|
|
|
+ if (borderType === 1) {
|
|
|
+ let objectLastRow = insertLast.lastChild;
|
|
|
+ let objectFirstRow = firstFirst.firstChild;
|
|
|
+ let lastRowId = objectLastRow.getAttribute('data-id');
|
|
|
+ let firstRowId = objectFirstRow.getAttribute('data-id');
|
|
|
+ if (lastRowId === firstRowId) {
|
|
|
+ let lastRowColumns = $(objectLastRow).find('.js-option-column');
|
|
|
+ let firstRowColumns = $(objectFirstRow).find('.js-option-column');
|
|
|
+ let rowColumnLength = lastRowColumns.length;
|
|
|
+ for (let rowColumnIndex = 0; rowColumnIndex < rowColumnLength; rowColumnIndex++) {
|
|
|
+ if (firstRowColumns[rowColumnIndex].firstChild && firstRowColumns[rowColumnIndex].firstChild.firstChild) {
|
|
|
+ this._insertDomBeforeByFirst($(lastRowColumns[rowColumnIndex].firstChild), firstRowColumns[rowColumnIndex].firstChild.firstChild);
|
|
|
+ } else {
|
|
|
+ if (lastRowColumns[rowColumnIndex].firstChild && firstRowColumns[rowColumnIndex].firstChild) {
|
|
|
+ let lastRowColumnsChilds = $(lastRowColumns[rowColumnIndex].firstChild).childNodes();
|
|
|
+ let lastRowColumnsChildsIndex = lastRowColumnsChilds.length - 1;
|
|
|
+ while(lastRowColumnsChildsIndex >= 0) {
|
|
|
+ firstRowColumns[rowColumnIndex].firstChild.appendChild(lastRowColumnsChilds[lastRowColumnsChildsIndex]);
|
|
|
+ lastRowColumnsChildsIndex--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(objectLastRow).remove();
|
|
|
+ this._insertDomBeforeByFirst($(insertLast), objectFirstRow);
|
|
|
+ } else {
|
|
|
+ this._insertDomBeforeByFirst($(insertLast), objectFirstRow);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let insertLastQuestion = insertLast.firstChild.lastChild;
|
|
|
+ let firstFirstQuestion = firstFirst.firstChild.firstChild;
|
|
|
+ this._mergeSplitBorder(insertLastQuestion, firstFirstQuestion, $(insertLast));
|
|
|
+ this._insertDomBeforeByFirst($Allparagraph, firstFirst);
|
|
|
+ }
|
|
|
} else {
|
|
|
// 如果不是同一个框
|
|
|
this._insertDomBeforeByFirst($Allparagraph, firstFirst);
|
|
@@ -360,7 +421,11 @@ yzPage.prototype = {
|
|
|
}
|
|
|
if (lQuestion.className && lQuestion.className.indexOf('js-lsiten-line') > -1) {
|
|
|
// 普通行处理
|
|
|
- this._insertDomBeforeByFirst($Allborder, fQuestion);
|
|
|
+ this._insertDomBeforeByFirst($($Allborder[0].firstChild), fQuestion);
|
|
|
+ $Allborder.remove();
|
|
|
+ } else if (lQuestion.className && lQuestion.className.indexOf('js-lsiten-options-box') > -1) {
|
|
|
+ // 选作题组
|
|
|
+ this._insertDomBeforeByFirst($($Allborder[0].firstChild), fQuestion);
|
|
|
$Allborder.remove();
|
|
|
} else if (lQuestion.className && lQuestion.className.indexOf('js-lsiten-question') > -1) {
|
|
|
// 主观题才需要合并
|
|
@@ -481,9 +546,17 @@ yzPage.prototype = {
|
|
|
// 如果有下一页,进行检测
|
|
|
if (nextColumn.column) {
|
|
|
let $nextParagraphs = nextColumn.column.find('.js-paragraph-view');
|
|
|
- while (i >=0 ) {
|
|
|
- if ($nextParagraphs[i]) {
|
|
|
- let $paragraph = $($nextParagraphs[i]);
|
|
|
+ let j = 0;
|
|
|
+ let nextParagraphLength = $nextParagraphs.length || 0;
|
|
|
+ while (j < nextParagraphLength) {
|
|
|
+ if (j > 0) {
|
|
|
+ let prevIndex = j - 1;
|
|
|
+ if ($nextParagraphs[prevIndex] && !isEmptyElement($nextParagraphs[prevIndex]) && !this.isHeadParagraph($($nextParagraphs[prevIndex]))) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($nextParagraphs[j]) {
|
|
|
+ let $paragraph = $($nextParagraphs[j]);
|
|
|
if ($paragraph && !this.isHeadParagraph($paragraph)) {
|
|
|
let pSize = $paragraph.getSizeData();
|
|
|
if (pSize.height < diff) {
|
|
@@ -496,11 +569,11 @@ yzPage.prototype = {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- i--;
|
|
|
+ j++;
|
|
|
}
|
|
|
let lastPid = $lastParagraph.attr('data-index');
|
|
|
let lastBorderItem = $lastParagraph[0].lastChild;
|
|
|
- let lastIsBorder = lastBorderItem.className && lastBorderItem.className.indexOf('js-lsiten-border') > -1;
|
|
|
+ let lastIsBorder = lastBorderItem && lastBorderItem.className && lastBorderItem.className.indexOf('js-lsiten-border') > -1;
|
|
|
$moves.forEach($paragraphITem => {
|
|
|
let currentPid = $paragraphITem.attr('data-index');
|
|
|
if (lastPid === currentPid) {
|
|
@@ -578,6 +651,9 @@ yzPage.prototype = {
|
|
|
} else {
|
|
|
lastBorderItem.firstChild.appendChild(borderItem);
|
|
|
}
|
|
|
+ } else if (itemClass && itemClass.indexOf('js-lsiten-options-box') > -1) {
|
|
|
+ // 选作题组【回退】
|
|
|
+ lastBorderItem.firstChild.appendChild(borderItem);
|
|
|
} else if (borderItem.className.indexOf('js-lsiten-line') > -1) {
|
|
|
lastBorderItem.firstChild.appendChild(borderItem);
|
|
|
} else {
|
|
@@ -640,7 +716,14 @@ yzPage.prototype = {
|
|
|
}
|
|
|
} else if (itemClass && itemClass.indexOf('js-lsiten-border') > -1) {
|
|
|
// 框处理
|
|
|
- this._prevBorder($prevParagraph, size, $item, $lastParagraph, true);
|
|
|
+ let borderType = parseInt($item.attr('data-type'));
|
|
|
+ if (borderType === 1) {
|
|
|
+ // 客观题处理
|
|
|
+ this._prevObjectBorder($prevParagraph, size, $item, $lastParagraph, true);
|
|
|
+ } else if (borderType === 2) {
|
|
|
+ // 主观观题处理
|
|
|
+ this._prevBorder($prevParagraph, size, $item, $lastParagraph, true);
|
|
|
+ }
|
|
|
} else {
|
|
|
$item.remove();
|
|
|
}
|
|
@@ -663,7 +746,13 @@ yzPage.prototype = {
|
|
|
}
|
|
|
} else if (itemClass && itemClass.indexOf('js-lsiten-border') > -1) {
|
|
|
// 框处理
|
|
|
- this._prevBorder($prevParagraph, size, $item, $lastParagraph, false);
|
|
|
+ let borderType = parseInt($item.attr('data-type'));
|
|
|
+ if (borderType === 1) {
|
|
|
+ // 客观题处理
|
|
|
+ this._prevObjectBorder($prevParagraph, size, $item, $lastParagraph, false);
|
|
|
+ } else if (borderType === 2) {
|
|
|
+ this._prevBorder($prevParagraph, size, $item, $lastParagraph, false);
|
|
|
+ }
|
|
|
} else {
|
|
|
$item.remove();
|
|
|
}
|
|
@@ -691,7 +780,13 @@ yzPage.prototype = {
|
|
|
}
|
|
|
} else if (itemClass && itemClass.indexOf('js-lsiten-border') > -1) {
|
|
|
// 框处理
|
|
|
- this._prevBorder($prevParagraph, size, $item, $lastParagraph, false);
|
|
|
+ let borderType = parseInt($item.attr('data-type'));
|
|
|
+ if (borderType === 1) {
|
|
|
+ // 客观题处理
|
|
|
+ this._prevObjectBorder($prevParagraph, size, $item, $lastParagraph, false);
|
|
|
+ } else if (borderType === 2) {
|
|
|
+ this._prevBorder($prevParagraph, size, $item, $lastParagraph, false);
|
|
|
+ }
|
|
|
} else {
|
|
|
$item.remove();
|
|
|
}
|
|
@@ -703,7 +798,28 @@ yzPage.prototype = {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+/**
|
|
|
+ * function 处理需要上移的框
|
|
|
+ * @param {DomElement} $prevParagraph 前移段落暂存
|
|
|
+ * @param {object} size 可移空间
|
|
|
+ * @param {DomElement} $border 需要处理的框
|
|
|
+ * @param {DomElement} $lastParagraph 最后一段dom
|
|
|
+ * @param {boolean} 是否需要合并
|
|
|
+ */
|
|
|
+ _prevObjectBorder: function ($prevParagraph, size, $border, $lastParagraph, isMerge) {
|
|
|
+ let lastCentent = $lastParagraph[0].lastChild;
|
|
|
+ if (lastCentent && lastCentent.className && lastCentent.className.indexOf('js-lsiten-border') > -1) {
|
|
|
+ let prevBid = $border.attr('data-id');
|
|
|
+ let bid = $(lastCentent).attr('data-id');
|
|
|
+ if (prevBid === bid) {
|
|
|
+ let $prevBorder = $border.clone(false);
|
|
|
+ if (isMerge) {
|
|
|
+ $prevBorder = $($prevParagraph[0].lastChild);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* function 处理需要上移的框
|
|
|
* @param {DomElement} $prevParagraph 前移段落暂存
|
|
@@ -714,7 +830,7 @@ yzPage.prototype = {
|
|
|
*/
|
|
|
_prevBorder: function ($prevParagraph, size, $border, $lastParagraph, isMerge) {
|
|
|
let lastCentent = $lastParagraph[0].lastChild;
|
|
|
- if (lastCentent.className && lastCentent.className.indexOf('js-lsiten-border') > -1) {
|
|
|
+ if (lastCentent && lastCentent.className && lastCentent.className.indexOf('js-lsiten-border') > -1) {
|
|
|
let prevBid = $border.attr('data-id');
|
|
|
let bid = $(lastCentent).attr('data-id');
|
|
|
if (prevBid === bid) {
|
|
@@ -743,38 +859,48 @@ yzPage.prototype = {
|
|
|
$prevBorder.append($prevBorderContent);
|
|
|
size.diff -= borderOutSize;
|
|
|
$borderContent.childNodes().forEach(item => {
|
|
|
- if (item.className) {
|
|
|
- if (item.className.indexOf('js-lsiten-question') > -1) {
|
|
|
- let qustionType = parseInt(item.getAttribute('data-type'));
|
|
|
- if (qustionType === 3) {
|
|
|
- this._prevSubjectQuestion($prevSubject, size, $(item), false);
|
|
|
- if (!isEmptyElement($prevSubject)) {
|
|
|
- $prevBorderContent.appendChild($prevSubject[0]);
|
|
|
+ if (!item.previousSibling) {
|
|
|
+ if (item.className) {
|
|
|
+ if (item.className.indexOf('js-lsiten-question') > -1) {
|
|
|
+ let qustionType = parseInt(item.getAttribute('data-type'));
|
|
|
+ if (qustionType === 3) {
|
|
|
+ let $prevSubject = $(item).clone(false);
|
|
|
+ this._prevSubjectQuestion($prevSubject, size, $(item), false);
|
|
|
+ if (!isEmptyElement($prevSubject)) {
|
|
|
+ $prevBorderContent[0].appendChild($prevSubject[0]);
|
|
|
+ }
|
|
|
+ } else if (qustionType === 4) {
|
|
|
+ let $prevWritting = $(item).clone(false);
|
|
|
+ this._prevWrittingQuestion($prevWritting, size, $(item), false);
|
|
|
+ if (!isEmptyElement($prevWritting)) {
|
|
|
+ $prevBorderContent[0].appendChild($prevWritting[0]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorderContent[0].appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
+ }
|
|
|
}
|
|
|
- } else if (qustionType === 4) {
|
|
|
- let $prevWritting = $(item).clone(false);
|
|
|
- this._prevWrittingQuestion($prevWritting, size, $(item), false);
|
|
|
- if (!isEmptyElement($prevWritting)) {
|
|
|
- $prevBorderContent.appendChild($prevWritting[0]);
|
|
|
+ } else if (item.className.indexOf('js-lsiten-line') > -1) {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorderContent[0].appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
}
|
|
|
- } else {
|
|
|
+ } else if (item.className.indexOf('js-lsiten-options-box') > -1) {
|
|
|
+ // 选作题组【回退】
|
|
|
let height = $(item).getSizeData().height;
|
|
|
if (height < size.diff) {
|
|
|
- $prevBorderContent.appendChild(item);
|
|
|
+ $prevBorderContent[0].appendChild(item);
|
|
|
size.diff -= height;
|
|
|
}
|
|
|
- }
|
|
|
- } else if (item.className.indexOf('js-lsiten-line') > -1) {
|
|
|
- let height = $(item).getSizeData().height;
|
|
|
- if (height < size.diff) {
|
|
|
- $prevBorderContent.appendChild(item);
|
|
|
- size.diff -= height;
|
|
|
+ } else {
|
|
|
+ $(item).remove();
|
|
|
}
|
|
|
} else {
|
|
|
- $(item).remove();
|
|
|
+ item && item.parentNode.removeChild(item);
|
|
|
}
|
|
|
- } else {
|
|
|
- item && item.parentNode.removeChild(item);
|
|
|
}
|
|
|
})
|
|
|
size.diff += borderOutSize;
|
|
@@ -784,10 +910,61 @@ yzPage.prototype = {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- let borderSize= $border.getSizeData();
|
|
|
- if (borderSize.height < size.diff) {
|
|
|
- $prevParagraph.append($border);
|
|
|
- size.diff -= borderSize.height;
|
|
|
+ // 框的padding+margin+border
|
|
|
+ let borderOutSize = 22;
|
|
|
+ let $prevBorder = $border.clone(false);
|
|
|
+ let $borderContent = $($border[0].firstChild);
|
|
|
+ let $prevBorderContent = $borderContent.clone(false);
|
|
|
+ $prevBorder.append($prevBorderContent);
|
|
|
+ size.diff -= borderOutSize;
|
|
|
+ $borderContent.childNodes().forEach(item => {
|
|
|
+ if (!item.previousSibling) {
|
|
|
+ if (item.className) {
|
|
|
+ if (item.className.indexOf('js-lsiten-question') > -1) {
|
|
|
+ let qustionType = parseInt(item.getAttribute('data-type'));
|
|
|
+ if (qustionType === 3) {
|
|
|
+ let $prevSubject = $(item).clone(false);
|
|
|
+ this._prevSubjectQuestion($prevSubject, size, $(item), false);
|
|
|
+ if (!isEmptyElement($prevSubject)) {
|
|
|
+ $prevBorderContent.appendChild($prevSubject[0]);
|
|
|
+ }
|
|
|
+ } else if (qustionType === 4) {
|
|
|
+ let $prevWritting = $(item).clone(false);
|
|
|
+ this._prevWrittingQuestion($prevWritting, size, $(item), false);
|
|
|
+ if (!isEmptyElement($prevWritting)) {
|
|
|
+ $prevBorderContent.appendChild($prevWritting[0]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorderContent.appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (item.className.indexOf('js-lsiten-line') > -1) {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorderContent[0].appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
+ }
|
|
|
+ } else if (item.className.indexOf('js-lsiten-options-box') > -1) {
|
|
|
+ // 选作题组【回退】
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorderContent[0].appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $(item).remove();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item && item.parentNode.removeChild(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ size.diff += borderOutSize;
|
|
|
+ if (!isEmptyElement($prevBorderContent[0])) {
|
|
|
+ $prevParagraph.append($prevBorder);
|
|
|
}
|
|
|
}
|
|
|
if (isEmptyElement($border[0].firstChild)) {
|
|
@@ -806,25 +983,48 @@ yzPage.prototype = {
|
|
|
let lastQuestion = $lastBorder[0].firstChild.lastChild;
|
|
|
let $borderContent = $($border[0].firstChild);
|
|
|
$borderContent.childNodes().forEach(item => {
|
|
|
- if (item.className) {
|
|
|
- if (item.className.indexOf('js-lsiten-question') > -1) {
|
|
|
- let qustionType = parseInt(item.getAttribute('data-type'));
|
|
|
- let questionId = item.getAttribute('data-id');
|
|
|
- if (lastQuestion.className && lastQuestion.className.indexOf('js-lsiten-question') > -1) {
|
|
|
- let lastQuestionId = lastQuestion.getAttribute('data-id');
|
|
|
- if (questionId && lastQuestionId && lastQuestionId === questionId) {
|
|
|
- // 需要合并2个小问
|
|
|
- if (qustionType === 3) {
|
|
|
- this._prevSubjectQuestion($(lastQuestion), size, $(item), true);
|
|
|
- } else if (qustionType === 4) {
|
|
|
- this._prevWrittingQuestion($(lastQuestion), size, $(item), true);
|
|
|
+ if (!item.previousSibling) {
|
|
|
+ if (item.className) {
|
|
|
+ if (item.className.indexOf('js-lsiten-question') > -1) {
|
|
|
+ let qustionType = parseInt(item.getAttribute('data-type'));
|
|
|
+ let questionId = item.getAttribute('data-id');
|
|
|
+ if (lastQuestion.className && lastQuestion.className.indexOf('js-lsiten-question') > -1) {
|
|
|
+ let lastQuestionId = lastQuestion.getAttribute('data-id');
|
|
|
+ if (questionId && lastQuestionId && lastQuestionId === questionId) {
|
|
|
+ // 需要合并2个小问
|
|
|
+ if (qustionType === 3) {
|
|
|
+ this._prevSubjectQuestion($(lastQuestion), size, $(item), true);
|
|
|
+ } else if (qustionType === 4) {
|
|
|
+ this._prevWrittingQuestion($(lastQuestion), size, $(item), true);
|
|
|
+ } else {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorder[0].firstChild.appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- let height = $(item).getSizeData().height;
|
|
|
- if (height < size.diff) {
|
|
|
- $prevBorder[0].firstChild.appendChild(item);
|
|
|
- size.diff -= height;
|
|
|
+ if (qustionType === 3) {
|
|
|
+ let $prevSubject = $(item).clone(false);
|
|
|
+ this._prevSubjectQuestion($prevSubject, size, $(item), false);
|
|
|
+ if (!isEmptyElement($prevSubject[0])) {
|
|
|
+ $prevBorder[0].firstChild.appendChild($prevSubject[0]);
|
|
|
+ }
|
|
|
+ } else if (qustionType === 4) {
|
|
|
+ let $prevWritting = $(item).clone(false);
|
|
|
+ this._prevWrittingQuestion($prevWritting, size, $(item), false);
|
|
|
+ if (!isEmptyElement($prevWritting[0])) {
|
|
|
+ $prevBorder[0].firstChild.appendChild($prevWritting[0]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorder[0].firstChild.appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
if (qustionType === 3) {
|
|
|
let $prevSubject = $(item).clone(false);
|
|
@@ -846,39 +1046,18 @@ yzPage.prototype = {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- } else {
|
|
|
- if (qustionType === 3) {
|
|
|
- let $prevSubject = $(item).clone(false);
|
|
|
- this._prevSubjectQuestion($prevSubject, size, $(item), false);
|
|
|
- if (!isEmptyElement($prevSubject[0])) {
|
|
|
- $prevBorder[0].firstChild.appendChild($prevSubject[0]);
|
|
|
- }
|
|
|
- } else if (qustionType === 4) {
|
|
|
- let $prevWritting = $(item).clone(false);
|
|
|
- this._prevWrittingQuestion($prevWritting, size, $(item), false);
|
|
|
- if (!isEmptyElement($prevWritting[0])) {
|
|
|
- $prevBorder[0].firstChild.appendChild($prevWritting[0]);
|
|
|
- }
|
|
|
- } else {
|
|
|
- let height = $(item).getSizeData().height;
|
|
|
- if (height < size.diff) {
|
|
|
- $prevBorder[0].firstChild.appendChild(item);
|
|
|
- size.diff -= height;
|
|
|
- }
|
|
|
+ } else if (item.className.indexOf('js-lsiten-line') > -1) {
|
|
|
+ let height = $(item).getSizeData().height;
|
|
|
+ if (height < size.diff) {
|
|
|
+ $prevBorder[0].firstChild.appendChild(item);
|
|
|
+ size.diff -= height;
|
|
|
}
|
|
|
- }
|
|
|
- } else if (item.className.indexOf('js-lsiten-line') > -1) {
|
|
|
- let height = $(item).getSizeData().height;
|
|
|
- if (height < size.diff) {
|
|
|
- $prevBorder[0].firstChild.appendChild(item);
|
|
|
- size.diff -= height;
|
|
|
+ } else {
|
|
|
+ $(item).remove();
|
|
|
}
|
|
|
} else {
|
|
|
- $(item).remove();
|
|
|
+ item && item.parentNode.removeChild(item);
|
|
|
}
|
|
|
- } else {
|
|
|
- item && item.parentNode.removeChild(item);
|
|
|
}
|
|
|
})
|
|
|
},
|