Skip to content

fixing regression for project picker - dblclick not working #1243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions web/js/searchable-option-list-2.0.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
.keydown(function (e) {
if (e.keyCode == 13) {
var concat = '';
$("#sbox #qtbl input").each(function () {
$("#sbox #qtbl input[type='text']").each(function () {
concat += $.trim($(this).val());
});
if (e.keyCode == 13 && concat === '') {
Expand All @@ -287,22 +287,22 @@
window.location = document.xrefPath + '/' + self.$input.val();
return false;
}
var $el = $(".keyboard-selection").first()
var $el = $(".keyboard-selection").first().find(".sol-checkbox")
// follow the actual project
if($el.length) {
if($el.length && $el.data('sol-item') &&
$el.data('sol-item').label) {
window.location = document.xrefPath +
'/' +
$el.find(".sol-label-text").text();
$el.data('sol-item').label;
return false;
}
// follow first selected project
$el = $(".sol-selected-display-item-text").first()
if($el.length) {
window.location = document.xrefPath + '/' + $el.text();
$el = $(".sol-selected-display-item").first()
if($el.length && $el.data('label')) {
window.location = document.xrefPath + '/' + $el.data('label');
return false;
}
return false;
} else if (e.keyCode == 13) {
}
return true;
}
Expand Down Expand Up @@ -787,13 +787,18 @@
var self = this,
$actualTargetContainer = $optionalTargetContainer || this.$selection,
$inputElement,
/*
* Modified 2016
*/
$labelText = $('<div class="sol-label-text"/>')
.html(solOption.label.trim().length === 0 ? '&nbsp;' : solOption.label)
.html(solOption.label.trim().length === 0 ? '&nbsp;' : solOption.label)
.addClass(solOption.cssClass),
$label,
$displayElement,
inputName = this._getNameAttribute();

/*
* Modified 2016
*/
var data = $(solOption.element).data('messages');
if (data && data.length) {
$labelText.append(
Expand Down Expand Up @@ -859,10 +864,15 @@
* Modified 2016
*/
$displayElement = $('<div class="sol-option"/>').dblclick(function (e) {
// go first project
window.location = document.xrefPath + '/' + $(this).text();
var $el = $(this).find('.sol-checkbox');
if ($el.length && $el.data('sol-item') && $el.data('sol-item').label) {
// go first project
window.location = document.xrefPath + '/' + $(this).find('.sol-checkbox').data('sol-item').label;
}
}).append($label);

/*
* Modified 2016
*/
$inputElement.data('messages-available', data && data.length);

solOption.displayElement = $displayElement;
Expand Down Expand Up @@ -993,6 +1003,7 @@
$existingDisplayItem = $('<div class="sol-selected-display-item"/>')
.append($displayItemText)
.attr('title', solOptionItem.tooltip)
.data('label', solOptionItem.label)
.appendTo(this.$showSelectionContainer);

// show remove button on display items if not disabled and null selection allowed
Expand Down
Loading