From f52cf41a358dd84afefed9d75d74f7e4daebef2c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 30 Jan 2016 20:31:20 +0100 Subject: [PATCH] As fallback use first element in selection. --- app/assets/javascripts/app/lib/base/jquery.textmodule.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/javascripts/app/lib/base/jquery.textmodule.js b/app/assets/javascripts/app/lib/base/jquery.textmodule.js index 44b33c774..de628f457 100644 --- a/app/assets/javascripts/app/lib/base/jquery.textmodule.js +++ b/app/assets/javascripts/app/lib/base/jquery.textmodule.js @@ -58,6 +58,11 @@ if (!id) { id = _this.$widget.find('.dropdown-menu li:hover a').data('id') } + + // as fallback first element + if (!id) { + id = _this.$widget.find('.dropdown-menu li:first-child a').data('id') + } _this.take(id) return }