瀏覽代碼

Disable change access rights button if there are no servers selected.

DieFeM 7 年之前
父節點
當前提交
b3d108968e
共有 2 個文件被更改,包括 17 次插入1 次删除
  1. 16 0
      js/modules/user_games-assign.js
  2. 1 1
      modules/user_games/assign_home.php

+ 16 - 0
js/modules/user_games-assign.js

@@ -1,3 +1,19 @@
+$('document').ready(function(){
+	$('#change_access_rights_submit').prop('disabled', true);
+	$(".change_access_rights").each( function( index, element ){
+		$(element).on('change', function(){
+			if($(".change_access_rights:checked").length > 0)
+			{
+				$('#change_access_rights_submit').prop('disabled', false);
+			}
+			else
+			{
+				$('#change_access_rights_submit').prop('disabled', true);
+			}
+		});
+	});
+});
+
 function change_access_rights(id_type, assign_id)
 {
 	var rights = $("#dialog").data();

+ 1 - 1
modules/user_games/assign_home.php

@@ -303,7 +303,7 @@ function exec_ogp_module()
 				</tr>";
 		}
 		echo "</table>";
-		echo "<button onclick=\"change_access_rights('".trim($id_type)."', '".trim($assign_id),"')\">".get_lang('change_access_rights_for_selected_servers')."</button>\n".
+		echo "<button id=\"change_access_rights_submit\" onclick=\"change_access_rights('".trim($id_type)."', '".trim($assign_id),"')\">".get_lang('change_access_rights_for_selected_servers')."</button>\n".
 			 "<div id='dialog' ";
 		foreach ( $selections as $selection => $flag)
 		{