Hi Robert
Is there an issue with the "wrap result text" function? I have ticked the box to wrap text but it doesn't work. The work around I'm using is to comment out the "white-space:pre" and the "white-space:pre-wrap" in the style.css, which works. Any advice would be good.
cheers
Rod
Solved! Go to Solution.
Rod,
I see the issue. Somehow some code was omitted from two different files.
Widget.js (line 2):
_initResultFormatString: function () { this.list._wrapResults = this.config.resultFormat.wrap || false;
List.js (line 8):
return declare([_WidgetBase, Evented], { 'class': 'widgets-Search-list', _itemCSS: "search-list-item", _itemSelectedCSS: "search-list-item selected", _itemAltCSS: "search-list-item alt", parentWidget: null, _wrapResults: null,
and in the add function (line 36 - 38):
add: function(item) { if (arguments.length === 0) { return; } this.items.push(item); var div = domConstruct.create("div"); domAttr.set(div, "id", this.id.toLowerCase()+item.id); var iconDiv = domConstruct.create("div"); domAttr.set(iconDiv, "id", this.id.toLowerCase()+item.id); domClass.add(iconDiv, "iconDiv"); domConstruct.place(iconDiv, div); var removeDiv = domConstruct.create('div'); domConstruct.place(removeDiv, div); domClass.add(removeDiv, 'removediv'); domAttr.set(removeDiv, 'id', this.id.toLowerCase()+item.id); var removeDivImg = domConstruct.create('div'); domClass.add(removeDivImg, 'removedivImg'); domConstruct.place(removeDivImg, removeDiv); domAttr.set(removeDivImg, 'id', this.id.toLowerCase()+item.id); domAttr.set(removeDivImg, 'title', item.removeResultMsg); this.own(on(removeDivImg, 'click', lang.hitch(this, this._onRemove))); var rTitle = domConstruct.create("p"); domAttr.set(rTitle, "id", this.id.toLowerCase()+item.id); domClass.add(rTitle, "title"); rTitle.textContent = rTitle.innerText = item.title; domConstruct.place(rTitle, div); if(item.alt){ domClass.add(div, this._itemAltCSS); }else{ domClass.add(div, this._itemCSS); } if(this._wrapResults){ domClass.add(div, "result-wrap"); }
Rod,
Version 2.0.1.2 is now available that addresses this bug.
Thanks for the prompt reply and fix Robert.
cheers
Rod