diff --git a/Composite/Plugins/Search/Endpoint/ConsoleSearchRpcService.cs b/Composite/Plugins/Search/Endpoint/ConsoleSearchRpcService.cs index 1fcdebad8b..5ad0fa9bc4 100644 --- a/Composite/Plugins/Search/Endpoint/ConsoleSearchRpcService.cs +++ b/Composite/Plugins/Search/Endpoint/ConsoleSearchRpcService.cs @@ -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() @@ -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() }); } diff --git a/Composite/Search/SearchQuery.cs b/Composite/Search/SearchQuery.cs index 351581ffbf..d83318ce3d 100644 --- a/Composite/Search/SearchQuery.cs +++ b/Composite/Search/SearchQuery.cs @@ -174,7 +174,7 @@ public void FilterByUser(string userName) /// /// Maximum amount of documents returned. /// - public int MaxDocumentsNumber; + public int MaxDocumentsNumber { get; set; } /// /// Facets to be returned. diff --git a/Website/Composite/scripts/source/top/ui/bindings/data/selectors/SelectorBinding.js b/Website/Composite/scripts/source/top/ui/bindings/data/selectors/SelectorBinding.js index d76c5a2a0b..ff6791f652 100644 --- a/Website/Composite/scripts/source/top/ui/bindings/data/selectors/SelectorBinding.js +++ b/Website/Composite/scripts/source/top/ui/bindings/data/selectors/SelectorBinding.js @@ -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; } /** diff --git a/Website/Composite/scripts/source/top/ui/bindings/popups/PopupBinding.js b/Website/Composite/scripts/source/top/ui/bindings/popups/PopupBinding.js index af2232536f..67810affa3 100644 --- a/Website/Composite/scripts/source/top/ui/bindings/popups/PopupBinding.js +++ b/Website/Composite/scripts/source/top/ui/bindings/popups/PopupBinding.js @@ -159,6 +159,12 @@ function PopupBinding () { */ this.hasImages = true; + /** + * @type {boolean} + */ + this.isManaged = false; + + /* * Returnable. */ @@ -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(); + } } /**