diff --git a/media/js/common.js b/media/js/common.js index 23a620b..18c8e03 100644 --- a/media/js/common.js +++ b/media/js/common.js @@ -82,13 +82,20 @@ $.fn.multiSelect = function(params) { var ms_params = { noneSelectedText: 'Wybierz', selectedText: make_selected_text(list_num), - header: false + header: false, + open: function () { + common.multiselect_is_open = true; + }, + close: function () { + common.multiselect_is_open = false; + } }; $.extend(ms_params, params); this.multiselect2(ms_params); }; var common = { + multiselect_is_open: false, multiselect_toggle: function(select_el, option_value, enable) { "use strict"; var select, widget, option; diff --git a/media/js/lexeme-edit.js b/media/js/lexeme-edit.js index 9eac040..48deff5 100644 --- a/media/js/lexeme-edit.js +++ b/media/js/lexeme-edit.js @@ -270,7 +270,9 @@ $.extend(edit, { $(document).on('keyup', '#id_entry', show_homonym_count); $('#edit').on('scroll', function() { - $(this).find('select[multiple]').multiselect2('close'); + if (common.multiselect_is_open) { + $(this).find('select[multiple]').multiselect2('close'); + } $('#id_new_owner').selectmenu('close'); }); diff --git a/media/js/pattern-edit.js b/media/js/pattern-edit.js index 7b5f2a6..c18b97d 100644 --- a/media/js/pattern-edit.js +++ b/media/js/pattern-edit.js @@ -40,8 +40,9 @@ $.extend(edit, { edit.show_changed(); }); $('#edit').on('scroll', function() { - $(this).find('select[multiple]').multiselect2('close'); - $('#id_new_owner').selectmenu('close'); + if (common.multiselect_is_open) { + $(this).find('select[multiple]').multiselect2('close'); + } }); $('#add-button').click(add_pattern); },