diff --git a/~dev_rating/media/js/discipline/edit.js b/~dev_rating/media/js/discipline/edit.js index ae56026b05e195af7048d6f2d218e5af8f166cac..305f78e85a36ffe79b96889cbf539abb58b82460 100644 --- a/~dev_rating/media/js/discipline/edit.js +++ b/~dev_rating/media/js/discipline/edit.js @@ -529,6 +529,7 @@ $(function() { return $(element).attr("id"); }); var ChangeOrderSubmodulesID = '[' + AttrID.get() + ']'; + ChangeSubmoduleMaxRate($(this).parent('div').parent('div').attr('id'), 0); // $.post( URLdir + 'handler/map/DeleteSubmodule', @@ -540,7 +541,24 @@ $(function() { function(data){ data = $.parseJSON(data); if(data.success === true) { + var sub = thisObj.parent('div').parent('div'); + var mod = sub.parent('div').parent('div').find('.moduleHead'); + // get old submodule values + var dif1 = sub.find('.currentControl').find('input').val(); + var dif2 = sub.find('.landmarkControl').find('input').val(); + + // change module header + var old = mod.find('.currentControl').html(); + mod.children('.currentControl').html(old - dif1); + + old = mod.find('.landmarkControl').html(); + mod.children('.landmarkControl').html(old - dif2); + + // change max rate + old = $('.RateIndicator').html(); + $('.RateIndicator').html(old - dif1 - dif2); thisObj.parent('div').parent('div').remove(); + EventInspector_ShowMsg('Мероприятие удалено', 'success'); } else EventInspector_ShowMsg('Ошибка при удаление мероприятия', 'error');