From 067bb81cd9f4f2c0a1bfd5f10dd3f1c46ac9364c Mon Sep 17 00:00:00 2001 From: PavelBegunkov <asml.Silence@gmail.com> Date: Fri, 26 Dec 2014 00:27:15 +0300 Subject: [PATCH] select adjustment --- .../teacher/discipline/CreateDiscipline.twig | 2 +- .../media/css/{ => icons}/select2-spinner.gif | Bin ~dev_rating/media/css/{ => icons}/select2.png | Bin .../media/css/{ => icons}/select2x2.png | Bin ~dev_rating/media/css/select2.css | 52 +++++++++--------- ~dev_rating/media/js/discipline/general.js | 2 +- 6 files changed, 27 insertions(+), 29 deletions(-) rename ~dev_rating/media/css/{ => icons}/select2-spinner.gif (100%) rename ~dev_rating/media/css/{ => icons}/select2.png (100%) rename ~dev_rating/media/css/{ => icons}/select2x2.png (100%) diff --git a/~dev_rating/application/views/teacher/discipline/CreateDiscipline.twig b/~dev_rating/application/views/teacher/discipline/CreateDiscipline.twig index 542f92f6a..4181be802 100644 --- a/~dev_rating/application/views/teacher/discipline/CreateDiscipline.twig +++ b/~dev_rating/application/views/teacher/discipline/CreateDiscipline.twig @@ -54,7 +54,7 @@ <div class="field"> {# <input class="InputSubject default_input_text" placeholder="Начните вводить название предмета" value=""> #} <select class="SelectSubject"> - <option>-Не выбран-</option> + {# <option>-Не выбран-</option> #} {% for Subject in SubjectsList %} <option value="{{ Subject.ID }}" {% if Discipline.SubjectID == Subject.ID %}selected{% endif %}>{{ Subject.Title }}</option> {% endfor %} diff --git a/~dev_rating/media/css/select2-spinner.gif b/~dev_rating/media/css/icons/select2-spinner.gif similarity index 100% rename from ~dev_rating/media/css/select2-spinner.gif rename to ~dev_rating/media/css/icons/select2-spinner.gif diff --git a/~dev_rating/media/css/select2.png b/~dev_rating/media/css/icons/select2.png similarity index 100% rename from ~dev_rating/media/css/select2.png rename to ~dev_rating/media/css/icons/select2.png diff --git a/~dev_rating/media/css/select2x2.png b/~dev_rating/media/css/icons/select2x2.png similarity index 100% rename from ~dev_rating/media/css/select2x2.png rename to ~dev_rating/media/css/icons/select2x2.png diff --git a/~dev_rating/media/css/select2.css b/~dev_rating/media/css/select2.css index 2d07a0343..7677a9c71 100644 --- a/~dev_rating/media/css/select2.css +++ b/~dev_rating/media/css/select2.css @@ -38,7 +38,7 @@ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 color: #444; text-decoration: none; - border-radius: 4px; + background-clip: padding-box; @@ -101,11 +101,11 @@ html[dir="rtl"] .select2-container .select2-choice > .select2-chosen { right: 24px; top: 8px; - font-size: 1px; + font-size: 14px; text-decoration: none; border: 0; - background: url('select2.png') right top no-repeat; + background: url('icons/select2.png') right top no-repeat; cursor: pointer; outline: 0; } @@ -218,7 +218,7 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow { display: block; width: 100%; height: 100%; - background: url('select2.png') no-repeat 0 1px; + background: url('icons/select2.png') no-repeat 0 1px; } html[dir="rtl"] .select2-container .select2-choice .select2-arrow b { @@ -247,8 +247,7 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow b { margin: 0; outline: 0; - font-family: sans-serif; - font-size: 1em; + font-size: 14px; border: 1px solid #aaa; border-radius: 0; @@ -256,21 +255,21 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow b { -webkit-box-shadow: none; box-shadow: none; - background: #fff url('select2.png') no-repeat 100% -22px; - background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); - background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; + background: #fff url('icons/select2.png') no-repeat 100% -22px; + background: url('icons/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('icons/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('icons/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('icons/select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; } html[dir="rtl"] .select2-search input { padding: 4px 5px 4px 20px; - background: #fff url('select2.png') no-repeat -37px -22px; - background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); - background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; + background: #fff url('icons/select2.png') no-repeat -37px -22px; + background: url('icons/select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('icons/select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('icons/select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('icons/select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; } .select2-drop.select2-drop-above .select2-search input { @@ -278,11 +277,11 @@ html[dir="rtl"] .select2-search input { } .select2-search input.select2-active { - background: #fff url('select2-spinner.gif') no-repeat 100%; - background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); - background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); - background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; + background: #fff url('icons/select2-spinner.gif') no-repeat 100%; + background: url('icons/select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('icons/select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('icons/select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('icons/select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; } .select2-container-active .select2-choice, @@ -451,7 +450,7 @@ disabled look for disabled choices in the results dropdown } .select2-more-results.select2-active { - background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%; + background: #f4f4f4 url('icons/select2-spinner.gif') no-repeat 100%; } .select2-results .select2-ajax-error { @@ -540,7 +539,6 @@ html[dir="rtl"] .select2-container-multi .select2-choices li padding: 5px; margin: 1px 0; - font-family: sans-serif; font-size: 100%; color: #666; outline: 0; @@ -551,7 +549,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices li } .select2-container-multi .select2-choices .select2-search-field input.select2-active { - background: #fff url('select2-spinner.gif') no-repeat 100% !important; + background: #fff url('icons/select2-spinner.gif') no-repeat 100% !important; } .select2-default { @@ -608,9 +606,9 @@ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice right: 3px; top: 4px; - font-size: 1px; + font-size: 14px; outline: none; - background: url('select2.png') right top no-repeat; + background: url('icons/select2.png') right top no-repeat; } html[dir="rtl"] .select2-search-choice-close { right: auto; @@ -693,7 +691,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice .select2-arrow b { - background-image: url('select2x2.png') !important; + background-image: url('icons/select2x2.png') !important; background-repeat: no-repeat !important; background-size: 60px 40px !important; } diff --git a/~dev_rating/media/js/discipline/general.js b/~dev_rating/media/js/discipline/general.js index a89355f3d..5f8540bb9 100644 --- a/~dev_rating/media/js/discipline/general.js +++ b/~dev_rating/media/js/discipline/general.js @@ -31,7 +31,7 @@ $(function() { ); } GetSubjectsList(); - $(".SelectSubject").select2(); + $(".SelectSubject").select2({placeholder: "Выберите предмет", allowClear: true}); // Сортировка списка -- GitLab