Skip to content

Commit

Permalink
Merge pull request #379 from Orckestra/dev
Browse files Browse the repository at this point in the history
Fix for #313 and Search API
  • Loading branch information
Marcus Wendt authored Feb 2, 2017
2 parents 261ddc1 + 927042d commit 22511fd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Composite/Plugins/Search/Endpoint/ConsoleSearchRpcService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ where selection.Values.Length > 0
Label = StringResourceSystemFacade.ParseString(facetField.Label),
Facets = selection.Values.Select(value => new ConsoleSearchResultFacetValue
{
Label = facetField.Facet.PreviewFunction(value),
Label = (facetField.Facet.PreviewFunction ?? (v => v))(value),
Value = value,
HitCount = 0
}).ToArray()
Expand Down Expand Up @@ -222,7 +222,7 @@ private ConsoleSearchResultFacetField[] GetFacets(SearchResult queryResult, ICol
{
Value = v.Value,
HitCount = v.HitCount,
Label = field.Facet.PreviewFunction(v.Value)
Label = (field.Facet.PreviewFunction ?? (value => value))(v.Value)
}).ToArray()
});
}
Expand Down
2 changes: 1 addition & 1 deletion Composite/Search/SearchQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void FilterByUser(string userName)
/// <summary>
/// Maximum amount of documents returned.
/// </summary>
public int MaxDocumentsNumber;
public int MaxDocumentsNumber { get; set; }

/// <summary>
/// Facets to be returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ SelectorBinding.prototype.buildPopup = function () {
popupBinding.addActionListener ( PopupBinding.ACTION_SHOW, this );
popupBinding.addActionListener ( MenuItemBinding.ACTION_COMMAND, this );
popupBinding.addActionListener ( PopupBinding.ACTION_HIDE, this );
this._buttonBinding.setPopup ( popupBinding );
this._buttonBinding.setPopup(popupBinding);

this._popupBinding.isManaged = true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ function PopupBinding () {
*/
this.hasImages = true;

/**
* @type {boolean}
*/
this.isManaged = false;


/*
* Returnable.
*/
Expand Down Expand Up @@ -468,9 +474,12 @@ PopupBinding.prototype.show = function () {

if ( this._bodyBinding instanceof MenuBodyBinding ) {
this._bodyBinding.refreshMenuGroups();
this._bodyBinding.grabKeyboard();
this._bodyBinding.bindingElement.tabIndex = "-1";
this._bodyBinding.bindingElement.focus();

if (!this.isManaged) {
this._bodyBinding.grabKeyboard();
this._bodyBinding.bindingElement.tabIndex = "-1";
this._bodyBinding.bindingElement.focus();
}
}

/**
Expand Down

0 comments on commit 22511fd

Please sign in to comment.