View | Details | Raw Unified | Return to bug 25727
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/css/select2.css (+21 lines)
Lines 7-9 Link Here
7
.select2-container .select2-selection--single.important_subfield_not_filled {
7
.select2-container .select2-selection--single.important_subfield_not_filled {
8
    background-color: #FFFF99;
8
    background-color: #FFFF99;
9
}
9
}
10
11
.select2-container--default .select2-selection--single .select2-selection__clear {
12
    color: #888;
13
    font-size: 125%;
14
    padding: 0 5px;
15
}
16
17
.select2-container--default .select2-selection--single .select2-selection__arrow {
18
    border-left: 1px solid #EEE;
19
    border-top-right-radius: 5px;
20
    border-bottom-right-radius: 5px;
21
    color: #666;
22
}
23
24
.select2-container--default .select2-selection--single .select2-selection__arrow:hover {
25
    background-color: #EEE;
26
}
27
28
.select2-container--default .select2-selection--single .select2-selection__arrow b {
29
    border-color: #565656 transparent transparent transparent;
30
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/select2.inc (-43 / +1 lines)
Lines 3-48 Link Here
3
[% Asset.js("lib/select2/js/select2.min.js") | $raw %]
3
[% Asset.js("lib/select2/js/select2.min.js") | $raw %]
4
[% Asset.css("lib/select2/css/select2.min.css") | $raw %]
4
[% Asset.css("lib/select2/css/select2.min.css") | $raw %]
5
[% Asset.css("css/select2.css") | $raw %]
5
[% Asset.css("css/select2.css") | $raw %]
6
<!-- select2.inc -->
6
[% Asset.js("js/select2.js") | $raw %]
7
<script>
8
  $.fn.select2.defaults.set("allowClear", true);
9
  $.fn.select2.defaults.set("placeholder", "");
10
  $.fn.select2.defaults.set("dropdownAutoWidth", true);
11
12
  // Internationalization
13
  $.fn.select2.defaults.set("language", {
14
      errorLoading:function(){return"The results could not be loaded."},
15
      inputTooLong:function(e){
16
          var n = e.input.length - e.max;
17
          return _("Please delete %d character(s)").format(n);
18
      },
19
      inputTooShort:function(e){
20
          var n = e.min - e.input.length;
21
          return _("Please enter %n or more characters").format(n);
22
      },
23
      formatResult: function(item) {
24
          return $('<div>', {title: item.element[0].title}).text(item.text);
25
      },
26
      loadingMore:function(){return"Loading more results…"},
27
      maximumSelected:function(e){
28
          return _("You can only select %s item(s)").format(e.max);
29
      },
30
      noResults:function(){return _("No results found")},
31
      searching:function(){return _("Searching…")},
32
      removeAllItems:function(){return _("Remove all items")},
33
      removeItem:function(){return _("Remove item")}
34
    });
35
36
    $(document).ready(function(){
37
        $(".select2").select2();
38
        $(".select2").on("select2:clear", function (evt) {
39
            $(this).on("select2:opening.cancelOpen", function (evt) {
40
                evt.preventDefault();
41
42
                $(this).off("select2:opening.cancelOpen");
43
            });
44
        });
45
    });
46
47
</script>
48
<!-- / select2.inc -->
(-)a/koha-tmpl/intranet-tmpl/prog/js/select2.js (-1 / +39 lines)
Line 0 Link Here
0
- 
1
/* global __ */
2
$.fn.select2.defaults.set("allowClear", true);
3
$.fn.select2.defaults.set("placeholder", "");
4
$.fn.select2.defaults.set("width", "element");
5
6
// Internationalization
7
$.fn.select2.defaults.set("language", {
8
    errorLoading:function(){ return __("The results could not be loaded"); },
9
    inputTooLong:function(e){
10
        var n = e.input.length - e.max;
11
        return __("Please delete %d character(s)").format(n);
12
    },
13
    inputTooShort:function(e){
14
        var n = e.min - e.input.length;
15
        return __("Please enter %n or more characters").format(n);
16
    },
17
    formatResult: function(item) {
18
        return $('<div>', {title: item.element[0].title}).text(item.text);
19
    },
20
    loadingMore:function(){ return __("Loading more results…"); },
21
    maximumSelected:function(e){
22
        return __("You can only select %s item(s)").format(e.max);
23
    },
24
    noResults:function(){return __("No results found"); },
25
    searching:function(){return __("Searching…"); },
26
    removeAllItems:function(){return __("Remove all items"); },
27
    removeItem:function(){return __("Remove item"); }
28
});
29
30
$(document).ready(function(){
31
    $(".select2").select2();
32
    $(".select2").on("select2:clear", function () {
33
        $(this).on("select2:opening.cancelOpen", function (evt) {
34
            evt.preventDefault();
35
36
            $(this).off("select2:opening.cancelOpen");
37
        });
38
    });
39
});

Return to bug 25727