Răsfoiți Sursa

Enter key on install works now.

Nathaniel van Diepen 11 ani în urmă
părinte
comite
ace0399a44
2 a modificat fișierele cu 7 adăugiri și 6 ștergeri
  1. 2 2
      install/index.template.html
  2. 5 4
      js/install.js

+ 2 - 2
install/index.template.html

@@ -45,5 +45,5 @@
 			<input name="dbpass" type="password"/>
 		</span>
 	</div>
-</form>
-<button value="Install" id="install">Install</button>
+	<input type="submit" value="Install" id="install"/>
+</form>

+ 5 - 4
js/install.js

@@ -2,16 +2,16 @@
 	var State = History.getState();
 	$(document).ready(function(){
 		if($.isEmptyObject(State.data)){
-			History.pushState({
+			History.replaceState({
 				type: 'install',
 				id: 'config'
-			},'Bugs','config');
+			},'Bugs');
 		}
 		$(window).on('statechange',function(){
 			State = History.getState();
 			$.get('api.php',State.data,function(d){
 				$('body').html(d);
-				$('#install').click(function(){
+				$('#config').submit(function(){
 					$('#install').attr('disabled','disabled');
 					$.get('api.php?'+$("#config").serialize()+'&dbtemplate=install&type=install&id=run',function(d){
 						if(d != "pass"){
@@ -21,7 +21,8 @@
 							alert('Installation successful!');
 							location = '..';
 						}
-					},'text')
+					},'text');
+					return false;
 				});
 			},'html');
 		}).trigger('statechange');