From 988720340dc944b33168f27e26502b162a5546eb Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 12 Apr 2016 22:25:29 +0000 Subject: [PATCH] Some more taglist issues: - stop extremely large sizing in some cases - make sure toggle button is correctly removed --- api/js/etemplate/et2_widget_taglist.js | 11 ++++++++--- api/js/jquery/magicsuggest/magicsuggest.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/et2_widget_taglist.js b/api/js/etemplate/et2_widget_taglist.js index df51fe4e6b..29ce5d2f1a 100644 --- a/api/js/etemplate/et2_widget_taglist.js +++ b/api/js/etemplate/et2_widget_taglist.js @@ -345,14 +345,19 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR }); $j('body').one('click',function() { taglist.collapse(); - });},1 + });},100 ); this.$taglist.one('collapse', function() { wrapper.remove(); - widget.div.removeClass('expanded'); }); - },this)); + },this)) + .on('collapse', function() { + widget.div.removeClass('expanded'); + }); + $j('.ms-trigger',this.div).on('click', function(e) { + e.stopPropagation(); + }) // Unbind change handler of widget's ancestor to stop it from bubbling // taglist has its own onchange $j(this.getDOMNode()).unbind('change.et2_inputWidget'); diff --git a/api/js/jquery/magicsuggest/magicsuggest.js b/api/js/jquery/magicsuggest/magicsuggest.js index b06b391444..95fac474d5 100644 --- a/api/js/jquery/magicsuggest/magicsuggest.js +++ b/api/js/jquery/magicsuggest/magicsuggest.js @@ -1085,7 +1085,7 @@ if(cfg.selectionPosition === 'inner' && !cfg.selectionContainer && ms.container.is(':visible')) { var inputPadding = ms.input.outerWidth(true) - ms.input.width(); ms.input.width(0); - inputOffset = ms.input.offset().left - ms.selectionContainer.offset().left; + inputOffset = Math.max(0,ms.input.offset().left - ms.selectionContainer.offset().left); w = ms.container.width() - inputOffset - (cfg.hideTrigger ? inputPadding : 42); ms.input.width(w); }