Skip to content
Snippets Groups Projects
Commit 6f66c382 authored by Антон Шалимов's avatar Антон Шалимов
Browse files

fix double change rate in rating

parent afed867b
Branches
Tags
No related merge requests found
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
} }
/* Прикрипление групп */ /* Прикрипление групп */
.ChangeStudyGroupDIV{ .ChangeStudyGroupDIV{
margin: 10px 0 5px 0; margin: 10px 0 5px 0;
......
...@@ -4,7 +4,7 @@ $(function() { ...@@ -4,7 +4,7 @@ $(function() {
var isFocusCell = false; // Стоит фокус или нет var isFocusCell = false; // Стоит фокус или нет
var oldRateCell; var oldRateCell;
// Ставим фокус // Ставим подстветку
function tdFocus(thisObj, thisClass){ function tdFocus(thisObj, thisClass){
tdClass = thisClass.split(' '); tdClass = thisClass.split(' ');
oldRateCell = thisObj.children('input').val(); oldRateCell = thisObj.children('input').val();
...@@ -16,7 +16,7 @@ $(function() { ...@@ -16,7 +16,7 @@ $(function() {
}); });
} }
// Убираем фокус // Убираем подстветку
function tdUnFocus(thisObj){ function tdUnFocus(thisObj){
oldRateCell = undefined; oldRateCell = undefined;
$('.'+tdClass[0]).each(function(){ $('.'+tdClass[0]).each(function(){
...@@ -29,6 +29,7 @@ $(function() { ...@@ -29,6 +29,7 @@ $(function() {
function Rating(thisObj, OldRate) { function Rating(thisObj, OldRate) {
// Здесь thisObj - div rateCell, а не input, который является дочкой // Здесь thisObj - div rateCell, а не input, который является дочкой
thisObj.children('input').attr("disabled", true);
// Получаем подмодуль // Получаем подмодуль
var reg = /col_\d+/; var reg = /col_\d+/;
var col = ''+reg.exec(thisObj.attr('class')); var col = ''+reg.exec(thisObj.attr('class'));
...@@ -60,6 +61,7 @@ $(function() { ...@@ -60,6 +61,7 @@ $(function() {
EventInspector_ShowMsg('Балл добавлен/изменен', 'success'); EventInspector_ShowMsg('Балл добавлен/изменен', 'success');
} }
else EventInspector_ShowMsg('Не удалось добавить/изменить балл', 'error'); else EventInspector_ShowMsg('Не удалось добавить/изменить балл', 'error');
thisObj.children('input').removeAttr('disabled');
} }
); );
} }
...@@ -69,6 +71,7 @@ $(function() { ...@@ -69,6 +71,7 @@ $(function() {
else else
thisObj.children('input').val('0'); thisObj.children('input').val('0');
EventInspector_ShowMsg('Текущий балл превышает максимальный для данного модуля', 'error'); EventInspector_ShowMsg('Текущий балл превышает максимальный для данного модуля', 'error');
thisObj.children('input').removeAttr('disabled');
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment