Skip to content

Commit 117c3ae

Browse files
committed
Merge branch '1.17.3-rc'
2 parents 26f6a8d + d06b616 commit 117c3ae

5 files changed

Lines changed: 114 additions & 108 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wolfnet-idx-for-wordpress",
3-
"version": "1.17.2",
3+
"version": "1.17.3",
44
"description": "WolfNet IDX for WordPress",
55
"homepage": "https://github.com/wolfnet/wordpressplugin",
66
"bugs": "https://github.com/wolfnet/wordpressplugin/issues",

public/css/wolfnet.less

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -370,40 +370,56 @@
370370

371371
}
372372

373-
&.wolfnet_smartSearch
374-
{
373+
&.wolfnet_smartSearch {
374+
375375
&.wnt-smartsearch {
376376
.wnt-smartsearch-input-container {
377377
width: 100%;
378378
}
379379
}
380380

381-
.wolfnet-suggestion-label
382-
{
383-
font-weight: bold;
384-
font-size: 1.1em;
385-
padding-left: 10px;
386-
display: inline-block;
387-
white-space: nowrap;
388-
overflow: hidden;
389-
text-overflow: ellipsis;
390-
}
381+
.wolfnet_smartSearch_form.wnt-smartsearch-narrow {
391382

392-
.wolfnet-suggestion-field
393-
{
394-
float: right;
395-
padding-right: 10px;
396-
font-size: 0.9em;
397-
}
383+
// Put min/max price, bed/bath, and submit button on own lines
384+
.wolfnet_smartPriceFields,
385+
.wolfnet_smartBedBathFields,
386+
.wolfnet_smartSubmit {
387+
width: 100%;
388+
clear: both;
389+
}
390+
391+
// Adjust widths of formfield pairs
392+
.wolfnet_smartMinPrice,
393+
.wolfnet_smartMaxPrice,
394+
.wolfnet_smartBeds,
395+
.wolfnet_smartBaths {
396+
width: 50%;
397+
}
398+
399+
}
400+
401+
.wolfnet-suggestion-label {
402+
font-weight: bold;
403+
font-size: 1.1em;
404+
padding-left: 10px;
405+
display: inline-block;
406+
white-space: nowrap;
407+
overflow: hidden;
408+
text-overflow: ellipsis;
409+
}
410+
411+
.wolfnet-suggestion-field {
412+
float: right;
413+
padding-right: 10px;
414+
font-size: 0.9em;
415+
}
398416

399-
.wnt-smart-menu
400-
{
417+
.wnt-smart-menu {
401418
display: inline-block;
402419
position:absolute;
403420
}
404421

405-
span.wnt-smart-search
406-
{
422+
span.wnt-smart-search {
407423
padding: 1em 1em 1em 1em;
408424
cursor: text;
409425
overflow: hidden;
@@ -414,28 +430,25 @@
414430
display: inline-block;
415431
text-align: left;
416432

417-
.wnt-ss-value
418-
{
433+
.wnt-ss-value {
419434
background-color: @quickSearchGrad2;
420435
border: 1px solid black;
421436
font-size: 1.1em;
422437
margin-right:.5em;
423438
padding: 0 5px 0 5px;
424439

425-
.wnt-close-btn
426-
{
440+
.wnt-close-btn {
427441
padding-left: 5px;
428442
cursor: pointer;
429443
font-weight: bold;
430444
}
431445
}
432446

433-
> span
434-
{
447+
> span {
435448
vertical-align: top;
436449

437450
input {
438-
background-color: white;
451+
background-color: white;
439452
height: 100%;
440453
border: 0 !important;
441454
padding: 0 !important;
@@ -447,25 +460,21 @@
447460

448461
}
449462

450-
.wnt-suggestions
451-
{
463+
.wnt-suggestions {
452464
border-top: 1px solid @quickSearchGrad2;
453465
border-bottom: 1px solid @quickSearchGrad2;
454466
border-left: 1px solid @quickSearchGrad2;
455467
border-right: 1px solid @quickSearchGrad2;
456468

457-
> div
458-
{
469+
> div {
459470
clear: both;
460471

461-
&.wnt-hover
462-
{
472+
&.wnt-hover {
463473
color: @quickSearchGrad2;
464474
background-color: gray;
465475
}
466476

467-
&.wnt-suggestion
468-
{
477+
&.wnt-suggestion {
469478
cursor: pointer;
470479
}
471480

public/js/jquery.wolfnetScrollingItems.src.js

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,17 @@ if (typeof jQuery != 'undefined') {
178178
*
179179
* @return null
180180
*/
181-
var cloneItems = function(target)
182-
{
183-
var $target = $(target);
184-
var data = getData(target);
185-
var containerWidth = data.$itemContainer.innerWidth();
186-
var $items = getItems(target);
181+
var cloneItems = function (target) {
182+
var $target = $(target);
183+
var data = getData(target);
184+
var $items = getItems(target);
187185

188-
if (
189-
(containerWidth) &&
190-
($items.length) &&
191-
(data.itemWidth) &&
192-
containerWidth >= (($items.length * data.itemWidth) / 2)
193-
) {
194-
$items.clone().appendTo(data.$itemContainer);
195-
cloneItems(target, containerWidth);
196-
}
186+
if (!hasEnoughItems(target)) {
187+
var $newItems = $items.clone().appendTo(data.$itemContainer);
188+
cloneItems(target);
189+
}
197190

198-
};
191+
};
199192

200193

201194
/**
@@ -206,29 +199,24 @@ if (typeof jQuery != 'undefined') {
206199
*
207200
* @return null
208201
*/
209-
var hasEnoughItems = function(target)
210-
{
211-
var $target = $(target);
212-
var data = getData(target);
213-
214-
var numberOfItems = getItems(target).length;
215-
var itemWidth = data.itemWidth;
216-
var containerWidth = data.$itemContainer.innerWidth();
217-
218-
// Do not scroll if width of all items in scroller is less than container
219-
if ((numberOfItems) && (itemWidth) && (containerWidth) &&
220-
(numberOfItems * itemWidth) < containerWidth) {
221-
return false;
222-
}
202+
var hasEnoughItems = function (target) {
203+
var $target = $(target);
204+
var data = getData(target);
223205

224-
// Do not scroll a single item
225-
if ((numberOfItems) && numberOfItems == 1) {
226-
return false;
227-
}
206+
var numberOfItems = getItems(target).length;
207+
var itemWidth = data.itemWidth;
228208

229-
return true;
209+
// Do not scroll if width of all items in scroller is less than container
210+
// Do not scroll a single item
211+
return (
212+
(
213+
(itemWidth <= 0) ||
214+
(numberOfItems === 0) || (numberOfItems > 50) ||
215+
(data.containerWidth < ((numberOfItems * itemWidth) / 2))
216+
) && (numberOfItems !== 1)
217+
);
230218

231-
};
219+
};
232220

233221

234222
/**
@@ -389,6 +377,24 @@ if (typeof jQuery != 'undefined') {
389377
};
390378

391379

380+
var resizeTimeout = 0;
381+
382+
var onResize = function (target) {
383+
if (resizeTimeout) clearTimeout(resizeTimeout);
384+
resizeTimeout = setTimeout(function () { measureContainer(target); }, 50);
385+
};
386+
387+
388+
var measureContainer = function (target) {
389+
var data = getData(target);
390+
var $items = getItems(target);
391+
$items.hide();
392+
data.containerWidth = Math.max(data.$itemContainer.innerWidth(), data.itemWidth);
393+
$items.show();
394+
data.$itemContainer.css('max-width', data.containerWidth + 'px');
395+
};
396+
397+
392398
var methods = {
393399

394400
/**
@@ -419,6 +425,8 @@ if (typeof jQuery != 'undefined') {
419425
removeWhitespaceBetweenTags(target);
420426
data.itemWidth = getItems(target).first().outerWidth(true);
421427

428+
measureContainer(target);
429+
422430
if (data.option.showControls) {
423431
buildControls(target);
424432
}
@@ -445,11 +453,8 @@ if (typeof jQuery != 'undefined') {
445453

446454
var enoughItems = hasEnoughItems(target);
447455

448-
$(window).resize(function(){
449-
if ((data.resizing || false) === false) {
450-
data.resizing = true;
451-
data.resizing = false;
452-
}
456+
$(window).resize(function () {
457+
onResize(target);
453458
});
454459

455460
});

public/js/jquery.wolfnetSmartsearch.src.js

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121
submitted: false
2222
};
2323

24+
25+
var onResizeForm = function () {
26+
var $form = this.closest('form');
27+
28+
if (!isNaN($form.width()) && ($form.width() > 0) && ($form.width() <= 500)) {
29+
$form.addClass('wnt-smartsearch-narrow');
30+
} else {
31+
$form.removeClass('wnt-smartsearch-narrow');
32+
}
33+
34+
};
35+
36+
2437
var methods =
2538
{
2639

@@ -370,10 +383,8 @@
370383
var $suggestions = pluginData.suggestionContainer;
371384
var $form = $($smartSearch[0].form);
372385

373-
if ($form.width() <= 500) {
374-
// Apply narrow CSS based on container size
375-
methods.applyNarrowCSS($form);
376-
}
386+
$(window).on('resize', function () { onResizeForm.call($smartSearch); });
387+
onResizeForm.call($smartSearch);
377388

378389
$smartSearch.on('wntFocus', function(event){
379390
$searchInput.focus();
@@ -1142,30 +1153,6 @@
11421153
methods.refreshExistingValues($smartSearch, event);
11431154
}
11441155

1145-
},
1146-
1147-
applyNarrowCSS: function($form) {
1148-
1149-
// Put min/max price, bed/bath, and submit button on own lines
1150-
$form.find('.wolfnet_smartPriceFields').css({
1151-
width: "100%",
1152-
clear: "both"
1153-
});
1154-
$form.find('.wolfnet_smartBedBathFields').css({
1155-
width: "100%",
1156-
clear: "both"
1157-
});
1158-
$form.find('.wolfnet_smartSubmit').css({
1159-
width: "100%",
1160-
clear: "both"
1161-
});
1162-
1163-
// Adjust widths of formfield pairs
1164-
$form.find('.wolfnet_smartMinPrice').css({'width':'50%'});
1165-
$form.find('.wolfnet_smartMaxPrice').css({'width':'50%'});
1166-
$form.find('.wolfnet_smartBeds').css({'width':'50%'});
1167-
$form.find('.wolfnet_smartBaths').css({'width':'50%'});
1168-
11691156
}
11701157

11711158
};

readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ Please upgrade to the latest version of the plugin as we will be disabling our o
9393

9494
## Changelog
9595

96+
### 1.17.3
97+
98+
* Fix to prevent the featured listings scroller from crashing when used in a floating element
99+
* SmartSearch layout fix for use in sliders
100+
96101
### 1.17.2
97102

98103
* Fix to prevent zip codes from losing their leading zero(s) when applicable
@@ -101,7 +106,7 @@ Please upgrade to the latest version of the plugin as we will be disabling our o
101106
### 1.17.1
102107

103108
* Fix for sites that use Google Maps outside of this plugin
104-
* Fix for Javascript error in new Smart Search functionality
109+
* Fix for JavaScript error in new Smart Search functionality
105110

106111
### 1.17.0
107112

0 commit comments

Comments
 (0)