Skip to content

Commit c8ee33c

Browse files
authored
Merge pull request #1243 from tulinkry/picker-fix
fixing regression for project picker - dblclick not working
2 parents 2f09760 + 236b132 commit c8ee33c

File tree

4 files changed

+26
-42
lines changed

4 files changed

+26
-42
lines changed

web/js/searchable-option-list-2.0.2.js

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
.keydown(function (e) {
279279
if (e.keyCode == 13) {
280280
var concat = '';
281-
$("#sbox #qtbl input").each(function () {
281+
$("#sbox #qtbl input[type='text']").each(function () {
282282
concat += $.trim($(this).val());
283283
});
284284
if (e.keyCode == 13 && concat === '') {
@@ -287,22 +287,22 @@
287287
window.location = document.xrefPath + '/' + self.$input.val();
288288
return false;
289289
}
290-
var $el = $(".keyboard-selection").first()
290+
var $el = $(".keyboard-selection").first().find(".sol-checkbox")
291291
// follow the actual project
292-
if($el.length) {
292+
if($el.length && $el.data('sol-item') &&
293+
$el.data('sol-item').label) {
293294
window.location = document.xrefPath +
294295
'/' +
295-
$el.find(".sol-label-text").text();
296+
$el.data('sol-item').label;
296297
return false;
297298
}
298299
// follow first selected project
299-
$el = $(".sol-selected-display-item-text").first()
300-
if($el.length) {
301-
window.location = document.xrefPath + '/' + $el.text();
300+
$el = $(".sol-selected-display-item").first()
301+
if($el.length && $el.data('label')) {
302+
window.location = document.xrefPath + '/' + $el.data('label');
302303
return false;
303304
}
304305
return false;
305-
} else if (e.keyCode == 13) {
306306
}
307307
return true;
308308
}
@@ -787,13 +787,18 @@
787787
var self = this,
788788
$actualTargetContainer = $optionalTargetContainer || this.$selection,
789789
$inputElement,
790+
/*
791+
* Modified 2016
792+
*/
790793
$labelText = $('<div class="sol-label-text"/>')
791-
.html(solOption.label.trim().length === 0 ? '&nbsp;' : solOption.label)
794+
.html(solOption.label.trim().length === 0 ? '&nbsp;' : solOption.label)
792795
.addClass(solOption.cssClass),
793796
$label,
794797
$displayElement,
795798
inputName = this._getNameAttribute();
796-
799+
/*
800+
* Modified 2016
801+
*/
797802
var data = $(solOption.element).data('messages');
798803
if (data && data.length) {
799804
$labelText.append(
@@ -859,10 +864,15 @@
859864
* Modified 2016
860865
*/
861866
$displayElement = $('<div class="sol-option"/>').dblclick(function (e) {
862-
// go first project
863-
window.location = document.xrefPath + '/' + $(this).text();
867+
var $el = $(this).find('.sol-checkbox');
868+
if ($el.length && $el.data('sol-item') && $el.data('sol-item').label) {
869+
// go first project
870+
window.location = document.xrefPath + '/' + $(this).find('.sol-checkbox').data('sol-item').label;
871+
}
864872
}).append($label);
865-
873+
/*
874+
* Modified 2016
875+
*/
866876
$inputElement.data('messages-available', data && data.length);
867877

868878
solOption.displayElement = $displayElement;
@@ -993,6 +1003,7 @@
9931003
$existingDisplayItem = $('<div class="sol-selected-display-item"/>')
9941004
.append($displayItemText)
9951005
.attr('title', solOptionItem.tooltip)
1006+
.data('label', solOptionItem.label)
9961007
.appendTo(this.$showSelectionContainer);
9971008

9981009
// show remove button on display items if not disabled and null selection allowed

0 commit comments

Comments
 (0)