|
|
|
@ -372,7 +372,7 @@ var SingleTreeSelect = function (_TreeSelect) { |
|
|
|
// FILL RESULTS
|
|
|
|
// FILL RESULTS
|
|
|
|
// MAIN PART
|
|
|
|
// MAIN PART
|
|
|
|
var $container = this.$resultsBox.find('.main-part ul'); |
|
|
|
var $container = this.$resultsBox.find('.main-part ul'); |
|
|
|
this._fillContainer($container, tmpl_elementResult, { searchText: searchText, parentCategoryId: self.parentId }); |
|
|
|
this._fillContainer($container, tmpl_elementResult, { searchText: searchText, parentCategoryId: self.parentId, attached: false }); |
|
|
|
|
|
|
|
|
|
|
|
// OTHER PART
|
|
|
|
// OTHER PART
|
|
|
|
// // Если нет parentId, не нужно искать в других категориях
|
|
|
|
// // Если нет parentId, не нужно искать в других категориях
|
|
|
|
@ -844,11 +844,13 @@ var AbsBaseSelect = function () { |
|
|
|
var searchText = _ref6.searchText, |
|
|
|
var searchText = _ref6.searchText, |
|
|
|
_ref6$parentCategoryI = _ref6.parentCategoryId, |
|
|
|
_ref6$parentCategoryI = _ref6.parentCategoryId, |
|
|
|
parentCategoryId = _ref6$parentCategoryI === undefined ? null : _ref6$parentCategoryI, |
|
|
|
parentCategoryId = _ref6$parentCategoryI === undefined ? null : _ref6$parentCategoryI, |
|
|
|
|
|
|
|
_ref6$attached = _ref6.attached, |
|
|
|
|
|
|
|
attached = _ref6$attached === undefined ? true : _ref6$attached, |
|
|
|
_ref6$excludeCategory = _ref6.excludeCategoryId, |
|
|
|
_ref6$excludeCategory = _ref6.excludeCategoryId, |
|
|
|
excludeCategoryId = _ref6$excludeCategory === undefined ? null : _ref6$excludeCategory; |
|
|
|
excludeCategoryId = _ref6$excludeCategory === undefined ? null : _ref6$excludeCategory; |
|
|
|
|
|
|
|
|
|
|
|
// :FORMAT spec_list [{name, id}, ...]
|
|
|
|
// :FORMAT spec_list [{name, id}, ...]
|
|
|
|
var specList = this.dataTree.dataToList(parentCategoryId, false, excludeCategoryId); |
|
|
|
var specList = this.dataTree.dataToList(parentCategoryId, attached, excludeCategoryId); |
|
|
|
return specList.filter(function (el) { |
|
|
|
return specList.filter(function (el) { |
|
|
|
return el.name.toLowerCase().indexOf(searchText.toLowerCase()) !== -1; |
|
|
|
return el.name.toLowerCase().indexOf(searchText.toLowerCase()) !== -1; |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -860,12 +862,14 @@ var AbsBaseSelect = function () { |
|
|
|
searchText = _ref7$searchText === undefined ? "" : _ref7$searchText, |
|
|
|
searchText = _ref7$searchText === undefined ? "" : _ref7$searchText, |
|
|
|
_ref7$parentCategoryI = _ref7.parentCategoryId, |
|
|
|
_ref7$parentCategoryI = _ref7.parentCategoryId, |
|
|
|
parentCategoryId = _ref7$parentCategoryI === undefined ? null : _ref7$parentCategoryI, |
|
|
|
parentCategoryId = _ref7$parentCategoryI === undefined ? null : _ref7$parentCategoryI, |
|
|
|
|
|
|
|
_ref7$attached = _ref7.attached, |
|
|
|
|
|
|
|
attached = _ref7$attached === undefined ? true : _ref7$attached, |
|
|
|
_ref7$excludeCategory = _ref7.excludeCategoryId, |
|
|
|
_ref7$excludeCategory = _ref7.excludeCategoryId, |
|
|
|
excludeCategoryId = _ref7$excludeCategory === undefined ? null : _ref7$excludeCategory; |
|
|
|
excludeCategoryId = _ref7$excludeCategory === undefined ? null : _ref7$excludeCategory; |
|
|
|
|
|
|
|
|
|
|
|
$container.html(""); |
|
|
|
$container.html(""); |
|
|
|
$('.other-part').show(); |
|
|
|
$('.other-part').show(); |
|
|
|
var searchRes = this._search({ searchText: searchText, parentCategoryId: parentCategoryId, excludeCategoryId: excludeCategoryId }); |
|
|
|
var searchRes = this._search({ searchText: searchText, parentCategoryId: parentCategoryId, attached: attached, excludeCategoryId: excludeCategoryId }); |
|
|
|
if (!searchRes.length) { |
|
|
|
if (!searchRes.length) { |
|
|
|
if ($container.closest('div').hasClass('main-part')) { |
|
|
|
if ($container.closest('div').hasClass('main-part')) { |
|
|
|
$container.append('<li>Ничего не найдено</li>'); |
|
|
|
$container.append('<li>Ничего не найдено</li>'); |
|
|
|
@ -1429,16 +1433,10 @@ $(function () { |
|
|
|
var sb_loc_1 = new _SingleTreeSelect2.default($('#sb-location-2'), { obj: sb_loc_main }); |
|
|
|
var sb_loc_1 = new _SingleTreeSelect2.default($('#sb-location-2'), { obj: sb_loc_main }); |
|
|
|
var sb_loc_2 = new _SingleTreeSelect2.default($('#sb-location-3'), { obj: sb_loc_main }); |
|
|
|
var sb_loc_2 = new _SingleTreeSelect2.default($('#sb-location-3'), { obj: sb_loc_main }); |
|
|
|
|
|
|
|
|
|
|
|
// Убираем кнопки add-options, блокирем поиск, меняем подсказки
|
|
|
|
// Убираем кнопки add-options
|
|
|
|
sb_loc_main.dataPromise.then(function () { |
|
|
|
sb_loc_main.dataPromise.then(function () { |
|
|
|
sb_loc_1.$buttonAddOptions.remove(); |
|
|
|
sb_loc_1.$buttonAddOptions.remove(); |
|
|
|
sb_loc_main.$buttonAddOptions.remove(); |
|
|
|
sb_loc_main.$buttonAddOptions.remove(); |
|
|
|
// sb_loc_main.$searchInput.prop("readonly", true);
|
|
|
|
|
|
|
|
// sb_loc_1.$searchInput.prop("readonly", true);
|
|
|
|
|
|
|
|
// sb_loc_2.$searchInput.prop("readonly", true);
|
|
|
|
|
|
|
|
// sb_loc_main.$searchInput.prop("placeholder", "Выберите");
|
|
|
|
|
|
|
|
// sb_loc_1.$searchInput.prop("placeholder", "Выберите");
|
|
|
|
|
|
|
|
// sb_loc_2.$searchInput.prop("placeholder", "Выберите");
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
sb_loc_main.setNearbySelectBox(sb_loc_1); |
|
|
|
sb_loc_main.setNearbySelectBox(sb_loc_1); |
|
|
|
|