diff --git a/app/assets/javascripts/app/lib/base/bootstrap-tokenfield.js b/app/assets/javascripts/app/lib/base/bootstrap-tokenfield.js index 196cc0d0b..a81c22db1 100755 --- a/app/assets/javascripts/app/lib/base/bootstrap-tokenfield.js +++ b/app/assets/javascripts/app/lib/base/bootstrap-tokenfield.js @@ -135,7 +135,7 @@ } // Set up mirror for input auto-sizing - this.$mirror = $(''); + this.$mirror = $(''); this.$input.css('min-width', this.options.minWidth + 'px') $.each([ 'fontFamily', @@ -149,7 +149,12 @@ ], function (i, val) { _self.$mirror[0].style[val] = _self.$input.css(val); }); - this.$mirror.appendTo( 'body' ) + if (!$('.js-tokenfieldMirror').get(0)) { + this.$mirror.appendTo( 'body' ) + } + else { + this.$mirror = $('.js-tokenfieldMirror') + } // Insert tokenfield to HTML this.$wrapper.insertBefore( this.$element )