Browse Source

forcus in the first text input element

Kaoru FUZITA 9 years ago
parent
commit
f476d87d6b
2 changed files with 13 additions and 13 deletions
  1. 1 0
      src/main/webapp/WEB-INF/view/login/index.jsp
  2. 12 13
      src/main/webapp/js/admin/admin.js

+ 1 - 0
src/main/webapp/WEB-INF/view/login/index.jsp

@@ -91,5 +91,6 @@
 	<script type="text/javascript"
 		src="${f:url('/js/jquery-2.1.4.min.js')}"></script>
 	<script type="text/javascript" src="${f:url('/js/bootstrap.js')}"></script>
+	<script type="text/javascript" src="${f:url('/js/admin/admin.js')}"></script>
 </body>
 </html>

+ 12 - 13
src/main/webapp/js/admin/admin.js

@@ -1,14 +1,13 @@
-$(function(){
-    $('.table tr[data-href]').each(function(){
-        $(this).css('cursor','pointer').hover(
-            function(){ 
-                $(this).addClass('active'); 
-            },  
-            function(){ 
-                $(this).removeClass('active'); 
-            }).click( function(){ 
-                document.location = $(this).attr('data-href'); 
-            }
-        );
-    });
+$(function() {
+	$('input[type="text"]:first', '.login-box,section.content').focus();
+
+	$('.table tr[data-href]').each(function() {
+		$(this).css('cursor', 'pointer').hover(function() {
+			$(this).addClass('active');
+		}, function() {
+			$(this).removeClass('active');
+		}).click(function() {
+			document.location = $(this).attr('data-href');
+		});
+	});
 });