dever 7 gadi atpakaļ
vecāks
revīzija
0c9de4a277
1 mainītis faili ar 16 papildinājumiem un 5 dzēšanām
  1. 16 5
      main/assets/mobile/js/config.js

+ 16 - 5
main/assets/mobile/js/config.js

@@ -23,11 +23,22 @@ function updateUser(url)
 }
 
 $(function(){
-	$("#username").keydown(function(event){
-		if(event.which == 13) {
-			updateUser();
-		}
-	});
+	if ($("#username").length) {
+		$("#username").keydown(function(event){
+			if(event.which == 13) {
+				updateUser();
+			}
+		});
+	}
+	
+	if ($("#quit").length) {
+		$("#quit").click(function(event){
+			if(confirm('确定退出吗?')) {
+				var url = $(this).attr('url');
+				location.href = url;
+			}
+		});
+	}
 })