diff --git a/~dev_rating/media/js/discipline/general.js b/~dev_rating/media/js/discipline/general.js index aa0f23e350c9bc0142f91945db77e3ba8048700f..d85ad39b11601637f040ff1a9a25a1d7ea4d949b 100644 --- a/~dev_rating/media/js/discipline/general.js +++ b/~dev_rating/media/js/discipline/general.js @@ -30,6 +30,7 @@ $(function() { var jProto = $($.parseHTML("<option></option>")); selectSubject.html(""); + selectSubject.append($.parseHTML("<option></option>")); $.each(data, function (key, cur) { jProto.html(cur.Title).val(cur.ID); selectSubject.append(jProto.clone()); @@ -38,6 +39,8 @@ $(function() { ).always( function(success) { + if (selectSubject.children().first().is(":selected")) + selectSubject.select2({placeholder: "Выберите предмет", allowClear: true}); selectSubject.removeAttr("disabled"); } );