Browse Source

新增 相關資源預設類型

manto07m 3 năm trước cách đây
mục cha
commit
ea64428b6c
3 tập tin đã thay đổi với 20 bổ sung6 xóa
  1. 1 0
      assets/stylesheets/theme.css
  2. 17 4
      other-list.php
  3. 2 2
      script/js/global.js

+ 1 - 0
assets/stylesheets/theme.css

@@ -2231,6 +2231,7 @@ html.boxed.no-overflowscrolling.custom-scroll .inner-menu .nano > .nano-content
 
 .inner-menu a.menu-item.active {
 	background: #282d36;
+	color:#0088cc;
 }
 
 .inner-menu a.menu-item .label {

+ 17 - 4
other-list.php

@@ -15,6 +15,13 @@ if (!isset($_SESSION['loggedin'])) {
 	<script src="./script/js/global.js"></script>
 	<script src="./script/js/pdfobject.min.js"></script>
 	<script type="application/javascript">
+		var url_href = window.location.href;
+		var url = new URL(url_href);
+		var type = url.searchParams.get("type");
+		if (type === null) {
+			window.location.href = "other-list.php?type=收費建議";
+		}
+
 		var delFavoriteList = [];
 		var i = 0;
 		var path = [];
@@ -25,12 +32,18 @@ if (!isset($_SESSION['loggedin'])) {
 		var userName = '<?php echo $_SESSION['name']; ?>';
 		var url_href = window.location.href;
 		var url = new URL(url_href);
-		var type = url.searchParams.get("type");
 		var $grid;
 		var list;
 
+
+
 		pageHeader = "BIM程式庫";
 	</script>
+	<style>
+		.menu-item.active {
+			color: #0088CC;
+		}
+	</style>
 </head>
 
 <body>
@@ -57,7 +70,7 @@ if (!isset($_SESSION['loggedin'])) {
 						</inner-menu>
 						<div class="inner-body mg-main">
 							<div class="inner-toolbar">
-								
+
 							</div>
 							<filter-content2></filter-content2>
 							<div class="row">
@@ -65,7 +78,7 @@ if (!isset($_SESSION['loggedin'])) {
 									<section class="panel">
 										<div class="panel-body">
 											<h5 class="text-semibold text-dark text-uppercase">檔案下載</h5>
-											<div id="treeAjaxHTML"  style="height:800px"></div>
+											<div id="treeAjaxHTML" style="height:800px"></div>
 										</div>
 
 
@@ -219,7 +232,7 @@ if (!isset($_SESSION['loggedin'])) {
 						link.click();
 						document.body.removeChild(link);
 
-					}else if(data.node.text.includes(".pdf")){
+					} else if (data.node.text.includes(".pdf")) {
 						PDFObject.embed(data.node.a_attr.href, "#pdfFile");
 					}
 

+ 2 - 2
script/js/global.js

@@ -317,8 +317,8 @@ vm.component('side-bar-list', {
 </li>`,
     computed: {
         GetLocation() {
-            var pathname = window.location.pathname.split('/')[2];
-            var type = pathname.split('-')[0];
+            var pathname = window.location.pathname.split('/');            
+            var type = pathname[pathname.length-1]
             if (this.href.includes(type)) {
                 return true;
             } else {