From 6f66c3821d10e2d6c0b063dc89c47443794a34a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A8=D0=B0=D0=BB=D0=B8?=
 =?UTF-8?q?=D0=BC=D0=BE=D0=B2?= <solidovic@gmail.com>
Date: Wed, 24 Sep 2014 21:46:24 +0400
Subject: [PATCH] fix double change rate in rating

---
 ~dev_rating/media/css/discipline.css | 2 +-
 ~dev_rating/media/js/rating.js       | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/~dev_rating/media/css/discipline.css b/~dev_rating/media/css/discipline.css
index 7b1efcb3e..b1d63dd38 100644
--- a/~dev_rating/media/css/discipline.css
+++ b/~dev_rating/media/css/discipline.css
@@ -290,7 +290,7 @@
 		cursor: pointer;
 		font-size: 14px;
 	}
-
+	
 /* Прикрипление групп */
 .ChangeStudyGroupDIV{
 	margin: 10px 0 5px 0;
diff --git a/~dev_rating/media/js/rating.js b/~dev_rating/media/js/rating.js
index 2fc5b360a..d4eee2562 100644
--- a/~dev_rating/media/js/rating.js
+++ b/~dev_rating/media/js/rating.js
@@ -4,7 +4,7 @@ $(function() {
 	var isFocusCell = false; // Стоит фокус или нет
 	var oldRateCell;
 	
-	// Ставим фокус
+	// Ставим подстветку
 	function tdFocus(thisObj, thisClass){
 		tdClass = thisClass.split(' ');
 		oldRateCell = thisObj.children('input').val();
@@ -16,7 +16,7 @@ $(function() {
 		});
 	}
 	
-	// Убираем фокус
+	// Убираем подстветку
 	function tdUnFocus(thisObj){
 		oldRateCell = undefined;
 		$('.'+tdClass[0]).each(function(){
@@ -29,6 +29,7 @@ $(function() {
 	
 	function Rating(thisObj, OldRate) {
 		// Здесь thisObj - div rateCell, а не input, который является дочкой
+		thisObj.children('input').attr("disabled", true);
 		// Получаем подмодуль
 		var reg = /col_\d+/;
 		var col = ''+reg.exec(thisObj.attr('class'));
@@ -60,6 +61,7 @@ $(function() {
 						EventInspector_ShowMsg('Балл добавлен/изменен', 'success');
 					}
 					else EventInspector_ShowMsg('Не удалось добавить/изменить балл', 'error');
+					thisObj.children('input').removeAttr('disabled');
 				}
 			);
 		} 
@@ -69,6 +71,7 @@ $(function() {
 			else
 				thisObj.children('input').val('0');
 			EventInspector_ShowMsg('Текущий балл превышает максимальный для данного модуля', 'error');
+			thisObj.children('input').removeAttr('disabled');
 		}
 	}
 	
-- 
GitLab