Ver Fonte

Merge branch 'kevin' of http://10.1.1.202:3030/steve07s/BIM-Monitor into kevin

oransheep há 3 anos atrás
pai
commit
e25106a286
4 ficheiros alterados com 14 adições e 7 exclusões
  1. 3 2
      component-detail.php
  2. 9 3
      component-favorite.php
  3. 1 1
      home.php
  4. 1 1
      script/js/global.js

+ 3 - 2
component-detail.php

@@ -56,10 +56,10 @@ if (!isset($_SESSION['loggedin'])) {
 							<div class="inner-toolbar">
 								<ul>
 									<li class="right">
-										<a href="#" onclick="window.history.go(-2); return false;"><i class="fa fa-undo"></i> 返回</a>
+										<a href="#" onclick="window.history.go(-1); return false;"><i class="fa fa-undo"></i> 返回</a>
 									</li>
 									<li class="right">
-										<a href="#" onclick="AddFavorite();"><i id="heart" class="fa fa-heart"></i><span id="favorite"> 加入清單</span></a>
+										<div style="cursor: pointer;" onclick="AddFavorite();"><i id="heart" class="fa fa-heart"></i><span id="favorite"> 加入清單</span></div>
 									</li>
 								</ul>
 							</div>
@@ -201,6 +201,7 @@ if (!isset($_SESSION['loggedin'])) {
 						stack: stack_bar_top,
 						width: "100%"
 					});
+					console.log("add favorite: " + data);
 					isFavorite = true;
 					$("#heart").css("color", "Tomato");
 					$("#favorite").html('移出清單');

+ 9 - 3
component-favorite.php

@@ -83,6 +83,7 @@ if (!isset($_SESSION['loggedin'])) {
 
 	<script>
 		$(document).ready(function() {
+
 			$.ajax({
 				url: "./script/php/equipment_group_favorite.php",
 				type: "GET",
@@ -110,10 +111,15 @@ if (!isset($_SESSION['loggedin'])) {
 				console.log(error);
 			});
 
-
 		});
 
-
+		$(document).on("change", "input[name='delCheck']", function() {
+			if ($(this).prop('checked') === true) {
+				delFavoriteList.push($(this).attr('value'));
+			} else {
+				delFavoriteList.splice(delFavoriteList.indexOf($(this).attr('value')), 1);
+			}
+		});
 
 		function DelFavorite() {
 			$.ajax({
@@ -133,7 +139,7 @@ if (!isset($_SESSION['loggedin'])) {
 		}
 	</script>
 	<script src="script/js/3Dpic-favorite.js" type="module"></script>
-	
+
 </body>
 
 </html>

+ 1 - 1
home.php

@@ -133,4 +133,4 @@ if (!isset($_SESSION['loggedin'])) {
 	</section>
 </body>
 
-</html>
+</html>

+ 1 - 1
script/js/global.js

@@ -567,4 +567,4 @@ vm.component('isotope-item', {
         <div class="mg-description"><small style="display:none;">{{detail}}</small><small class="operate" style="display:none;">{{operate}}</small><small class="source" style="display:none;">{{source}}</small><small class="pull-right text-muted software" >{{software}}</small></div>
     </div>
 </div>`,
-});
+});