From 672b1ab40c5e307657d09b508155570bb80152f4 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 7 Jul 2017 16:47:15 +0200 Subject: [PATCH] Fixed issue #884 - Firefox - Focus lost after using :: TextSnippts. --- app/assets/javascripts/app/lib/base/jquery.textmodule.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/lib/base/jquery.textmodule.js b/app/assets/javascripts/app/lib/base/jquery.textmodule.js index 492229a00..6236f42d3 100644 --- a/app/assets/javascripts/app/lib/base/jquery.textmodule.js +++ b/app/assets/javascripts/app/lib/base/jquery.textmodule.js @@ -180,7 +180,7 @@ Plugin.prototype.renderBase = function() { this.$element.after('') this.$widget = this.$element.next() - this.$widget.on('click', 'li', $.proxy(this.onEntryClick, this)) + this.$widget.on('mousedown', 'li', $.proxy(this.onEntryClick, this)) this.$widget.on('mouseenter', 'li', $.proxy(this.onMouseEnter, this)) } @@ -313,6 +313,7 @@ } Plugin.prototype.onEntryClick = function(event) { + event.preventDefault() var id = $(event.target).data('id') this.take(id) }