From 555d20af5e63dbe9beb4e135cbb21cbf171c22dd Mon Sep 17 00:00:00 2001
From: xamgore <xamgore@ya.ru>
Date: Fri, 6 Mar 2015 09:45:18 +0300
Subject: [PATCH] FIX: cross sign disappears after switching a faculty

The cross sign and an ability to drop the selected item are restored.

Improves usability.
---
 ~dev_rating/media/js/discipline/general.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/~dev_rating/media/js/discipline/general.js b/~dev_rating/media/js/discipline/general.js
index aa0f23e35..d85ad39b1 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");
             }
         );
-- 
GitLab