From b496626c76f8ffb366cd810607f183bd4d3ba358 Mon Sep 17 00:00:00 2001 From: glebtv Date: Fri, 7 Apr 2017 19:04:06 +0300 Subject: [PATCH] Use first qor-field for select2-result-template and select2-selection-template This is needed for serializeable_meta because it wraps multiple fields with qor-field --- views/assets/javascripts/qor/qor-chooser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/assets/javascripts/qor/qor-chooser.js b/views/assets/javascripts/qor/qor-chooser.js index 3839b11c..4fcf15f0 100755 --- a/views/assets/javascripts/qor/qor-chooser.js +++ b/views/assets/javascripts/qor/qor-chooser.js @@ -39,13 +39,13 @@ option.ajax = $.fn.select2.ajaxCommonOptions; option.templateResult = function(data) { - var tmpl = $this.parents('.qor-field').find('[name="select2-result-template"]'); + var tmpl = $this.parents('.qor-field').first().find('[name="select2-result-template"]'); return $.fn.select2.ajaxFormatResult(data, tmpl); }; option.templateSelection = function(data) { if (data.loading) return data.text; - var tmpl = $this.parents('.qor-field').find('[name="select2-selection-template"]'); + var tmpl = $this.parents('.qor-field').first().find('[name="select2-selection-template"]'); return $.fn.select2.ajaxFormatResult(data, tmpl); }; } @@ -120,4 +120,4 @@ return QorChooser; -}); \ No newline at end of file +});