From 8a25c2ebc07626151bcb74c9bc8568e284e82791 Mon Sep 17 00:00:00 2001 From: janek37 <none@none> Date: Wed, 1 Apr 2015 14:56:05 +0200 Subject: [PATCH] podział na rodzaje w podglądzie wzoru --- media/js/common.js | 9 ++++++++- media/js/lexeme-edit.js | 4 +++- media/js/pattern-edit.js | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) 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); }, -- libgit2 0.22.2