Commit 8a25c2ebc07626151bcb74c9bc8568e284e82791

Authored by janek37
1 parent 55c9b770

podział na rodzaje w podglądzie wzoru

media/js/common.js
... ... @@ -82,13 +82,20 @@ $.fn.multiSelect = function(params) {
82 82 var ms_params = {
83 83 noneSelectedText: 'Wybierz',
84 84 selectedText: make_selected_text(list_num),
85   - header: false
  85 + header: false,
  86 + open: function () {
  87 + common.multiselect_is_open = true;
  88 + },
  89 + close: function () {
  90 + common.multiselect_is_open = false;
  91 + }
86 92 };
87 93 $.extend(ms_params, params);
88 94 this.multiselect2(ms_params);
89 95 };
90 96  
91 97 var common = {
  98 + multiselect_is_open: false,
92 99 multiselect_toggle: function(select_el, option_value, enable) {
93 100 "use strict";
94 101 var select, widget, option;
... ...
media/js/lexeme-edit.js
... ... @@ -270,7 +270,9 @@ $.extend(edit, {
270 270 $(document).on('keyup', '#id_entry', show_homonym_count);
271 271  
272 272 $('#edit').on('scroll', function() {
273   - $(this).find('select[multiple]').multiselect2('close');
  273 + if (common.multiselect_is_open) {
  274 + $(this).find('select[multiple]').multiselect2('close');
  275 + }
274 276 $('#id_new_owner').selectmenu('close');
275 277 });
276 278  
... ...
media/js/pattern-edit.js
... ... @@ -40,8 +40,9 @@ $.extend(edit, {
40 40 edit.show_changed();
41 41 });
42 42 $('#edit').on('scroll', function() {
43   - $(this).find('select[multiple]').multiselect2('close');
44   - $('#id_new_owner').selectmenu('close');
  43 + if (common.multiselect_is_open) {
  44 + $(this).find('select[multiple]').multiselect2('close');
  45 + }
45 46 });
46 47 $('#add-button').click(add_pattern);
47 48 },
... ...