Explorar o código

预览页面过期时不直接重载页面,只进行提示

sunyj %!s(int64=9) %!d(string=hai) anos
pai
achega
213a1f9851

+ 1 - 1
src/main/webapp/WEB-INF/views/files.html

@@ -34,7 +34,7 @@
 		</div>
 		<div id="listContentContainer">
 			<div id="parentPathContainer">
-				<i class='fa fa-level-up' aria-hidden='true'></i>&nbsp&nbsp&nbsp&nbsp
+				<i class='fa fa-level-up' aria-hidden='true'></i>&nbsp;&nbsp;&nbsp;&nbsp;
 				<span id="parentPath" class="likeHref">上级目录</span>
 			</div>
 		</div>

+ 0 - 2
src/main/webapp/resources/js/preview/app.js

@@ -346,7 +346,6 @@ function waitWholePdfGenerated() {
 	waitWholePdfGeneratedCount++;
 	if (waitWholePdfGeneratedCount >= MAX_WAIT_WHOLE_PDF_GENERATED) {
 		alert(spinnerContainer, ALERT_WAIT_WHOLE_PDF_GENERATED_TOO_LARGE);
-		window.location.reload();
 		return;
 	}
 	var valid = getGeneratedPdfOrXlsInformation("pdf").valid;
@@ -534,7 +533,6 @@ function timeout() {
 	var now = new Date();
 	if (now - startTime >= MAX_TIME) {
 		alert(spinnerContainer, ALERT_TIMEOUT);
-		window.location.reload();
 		return true;
 	}
 	return false;

+ 4 - 4
src/main/webapp/resources/js/util/utils.js

@@ -213,12 +213,12 @@ function hideLoading(spinner) {
  *            通知存在的时间
  */
 function alert(container, text, time) {
+	time = time || 3000;
+	container = container || document.body;
 	var div = document.getElementById('prompt');
 	if (div) {
-		div.remove();
+		container.removeChild(div);
 	}
-	time = time || 3000;
-	container = container || document.body;
 	div = document.createElement('div'), // 创建div对象
 	span = document.createElement('span'); // 创建span对象
 	div.id = 'prompt'; // div设置ID
@@ -240,7 +240,7 @@ function alert(container, text, time) {
 
 			// 隐藏后删除对象
 			timerRemove = setTimeout(function() {
-				div.remove(); // 删除对象
+				container.removeChild(div); // 删除对象
 				clearTimeout(timerRemove); // 清除定时器
 			}, 400);