apartment for sale, 2 rooms - Tööstuse 47a, Kalamaja, Põhja-Tallinn, Tallinn, Harjumaa (2024)

Flats Houses Sharehouses New development Plots Premises More…

Garages New price Ready, auctions Modular houses

'); } if (e.keyCode === 38 || e.keyCode === 40) { if (!$autoSuggest.hasClass('hide')) { var totalElems = 0; var activeElem = 0; $autoSuggest.find('span').each(function () { totalElems++; if ($(this).hasClass('focus')) activeElem = totalElems; }); $autoSuggest.find('span.focus').removeClass('focus'); if (e.keyCode === 38) activeElem--; if (e.keyCode === 40) activeElem++; if (activeElem <= 0) activeElem = totalElems; if (activeElem > totalElems) activeElem = 1; $autoSuggest.find('span:nth-child(' + activeElem + ')').addClass('focus'); $('#keyword, .fake-keyword').val($autoSuggest.find('span.focus').data('keyword')); } } else if (e.keyCode === 27) { $(this).val(''); $autoSuggest.addClass('hide'); } else if (e.keyCode === 13) { var locationIds = $autoSuggest.find('span.focus').data('location'); if (locationIds && typeof (locationIds) !== 'undefined') { e.preventDefault(); Search.addressKeyword = $autoSuggest.find('span.focus').data('location-keyword'); Search.autosuggestLocations(locationIds); } $autoSuggest.addClass('hide'); } else { $autoSuggest.addClass('hide'); if (Search.autoCompleteTimeout) clearTimeout(Search.autoCompleteTimeout); Search.autoCompleteTimeout = setTimeout(Search.createAutoComplete, 200); } }); } if (DEVICE === 'mobile') { $('.fake-keyword').on('focus keyup', function (e) { $('#keyword, .fake-keyword').val($(this).val()).trigger('fake-keyword', [e.originalEvent]); }).on('blur', function () { $('#auto-suggest').addClass('hide'); }); let roomsPrefix = agentForm ? '#agent_rooms' : '#rooms'; $(roomsPrefix + '_select a').on('click', function () { let $min = $(roomsPrefix + '_min'); let $max = $(roomsPrefix + '_max'); let currVal = parseInt($(this).data('value')); if ($min.val() === parseInt($max.val()) && currVal === parseInt($min.val())) currVal = 0; if (!currVal) { $min.val(''); $max.val(''); } else if (!$min.val() && !$max.val()) { $min.val(currVal); $max.val(currVal); } else if (parseInt($min.val()) === currVal) { $min.val(currVal + 1); } else if (parseInt($max.val()) === currVal || !$max.val() && currVal === 5) { $max.val(currVal - 1); } else { $min.val() < currVal ? $max.val(currVal) : $min.val(currVal); } if (parseInt($max.val()) === 5) { $max.val(''); if (!$min.val()) $min.val(5); } $min.trigger('change'); }); $(roomsPrefix + '_min, ' + roomsPrefix + '_max').on('change', function () { let min = parseInt($(roomsPrefix + '_min').val()); let max = parseInt($(roomsPrefix + '_max').val()); if (!max) max = 5; let $roomsSelect = $(roomsPrefix + '_select a'); $roomsSelect.removeClass('active'); if (!min) { $roomsSelect.first().addClass('active'); } else { for (var i = min; i <= max; i++) { $roomsSelect.eq(i).addClass('active'); } } }).trigger('change'); $('.main-search .collapse a').on('click', function () { setTimeout(function () { if ($('#search-outer,#search-outer-modulars,#search-outer-developments').hasClass('show')) { $('.main-menu').removeClass('hide'); } else if (PAGE !== 'home') { $('.main-menu').addClass('hide'); } }); }); $('#rooms_min').on('change', function () { log('max => ' + $('#rooms_max').val()); }); $('#short-search').on('stateChanged', function () { let copyElem; if (Search.resetPages.includes(PAGE) && ($(this).hasClass('show') || (!$(this).hasClass('show') && !$(this).hasClass('hide')))) { $('.main-search div[data-copy-short-search]').each(function () { copyElem = $($(this).data('copy-short-search')); copyElem.after('

'); $(this).replaceWith(copyElem); let cityElem = $('[data-group="city"]'); if (cityElem.html() === '') { $('.short-search-city').addClass('hide'); } }); } else { Search.hideMobileSearch(); } }); } Search.$form.on('submit', function () { KV.newSearch = true; }); if (agentForm) { setTimeout(function () { Search.loading(false); }, 300); } }, createAutoComplete: function () { let urlParams = KV.trimUrl('/search/keyword' + '&' + Search.$form.serialize(), Search.$form.data('post-trim')); KV.api('/search/keyword' + urlParams, null, function (res) { if (res['items']) { let keyword = $('#keyword' + (MOBILE ? ', .fake-keyword' : '')).val().trim(); let html = ''; for (var row of res['items']) { var pattern = '(' + keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + ')'; row['label'] = row['label'].toString() .replace(new RegExp(pattern, 'gi'), '$1') .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/<(\/?strong)>/g, '<$1>'); html += ''; if (row['location_str']) html += ' ' + row['location_str'] + ''; html += row['label']; if (row['category']) html += ' ' + lang('lbl_autocomplete_' + row['category']) + ''; html += ''; } if (html) { if (!keyword) { html = '

' + lang('popular_searches') + '

' + html + '

'; } $('#auto-suggest').html(html).removeClass('hide'); setTimeout(function () { $('#auto-suggest span').on('mousedown tap', function () { let locationIds = $(this).data('location'); let $this = $(this); if (locationIds && typeof (locationIds) !== 'undefined') { Search.addressKeyword = $(this).data('location-keyword'); Search.autosuggestLocations(locationIds, false); } else { let keyword = ''; if ($this.data('company-id')) { Search.$form.find('input[name="company_id"]').val($this.data('company-id')); } else if ($this.data('broker-id')) { Search.$form.find('input[name="broker_id"]').val($this.data('broker-id')); } else if ($this.data('keyword')) { keyword = $this.data('keyword'); } $('#keyword, .fake-keyword').val(keyword); $('#auto-suggest').addClass('hide'); Search.$form.submit(); } }); }, 100); } else { $('#auto-suggest').addClass('hide'); } } }); }, createParishSelect: function (opts) { if (!opts) { Search.$form.find('[name="parish"]').prop('disabled', true).find('option').not(':first,:disabled').remove(); return false; } opts.sort((a, b) => (a['new_parish_name'] > b['new_parish_name']) ? 1 : -1); var html = ''; var usedOpts = []; for (var i in opts) { if (!usedOpts.includes(opts[i]['new_parish_name'])) { usedOpts.push(opts[i]['new_parish_name']); html += '

'; if (opts[i]['old_parish_count'] > 1) { for (var i2 in opts) { if (opts[i2]['new_parish_id'] !== opts[i]['new_parish_id']) continue; html += '

'; } } } } let parishVal = (typeof Search.tmp_parish_id != 'undefined' ? Search.tmp_parish_id : ''); Search.$form.find('[name="parish"]').prop('disabled', false).append(html).val(parishVal).trigger('change'); delete Search.tmp_parish_id; if (Search.$form.attr('id') === 'agent_searchform') { Search.$form.find('select[name="parish"]').prop('disabled', true); } if (Search.submitAfter === 'parish') { $('#keyword, .fake-keyword').val(Search.addressKeyword); Search.$form.submit(); delete Search.submitAfter; } }, createCitySelect: function (opts) { if (!opts) { Search.$form.find('[data-group="city"]').html(''); return false; } opts.sort((a, b) => (a['city_name'] > b['city_name']) ? 1 : -1); var html = '

'; var htmlAfter = ''; for (var i in opts) { if (opts[i]['parent_city_id']) continue; var sub = ''; for (var i2 in opts) { if (opts[i2]['parent_city_id'] !== opts[i]['city_id']) continue; sub += ''; sub += ''; } var currHtml = ''; currHtml += ''; if (sub) { html += currHtml + sub; html += '

'; } else { htmlAfter += currHtml; } } Search.$form.find('[data-group="city"]').html(html + '

' + lang('lbl_cities') + '

' + htmlAfter + '

'); if (Search.tmp_city_id) { Search.$form.find('#city_' + Search.tmp_city_id).attr('checked', true); delete Search.tmp_city_id; } Search.$form.find('[data-group="city"] input').on('change', function () { if ($(this).data('parent-id')) { Search.$form.find('[data-group="city"] input[value="' + $(this).data('parent-id') + '"]') .prop( 'checked', Search.$form.find('[data-group="city"] input[data-parent-id="' + $(this).data('parent-id') + '"]').length === Search.$form.find('[data-group="city"] input[data-parent-id="' + $(this).data('parent-id') + '"]:checked').length ); } else { Search.$form.find('[data-group="city"] input[data-parent-id="' + $(this).val() + '"]').prop('checked', $(this).prop('checked')); } }); Search.$form.find('[data-group="city"]').parent().removeClass('hide'); if (Search.submitAfter === 'city') { $('#keyword, .fake-keyword').val(Search.addressKeyword); Search.$form.submit(); delete Search.submitAfter; } }, showGroups: function (noAnimation) { let dealType = Search.$form.find('[name="deal_type"]').val(); let mainDealType = Search.getMainDealType(dealType); let showGroups = Object.assign([], Search.dtGroups[mainDealType]); showGroups.push('deal_type', 'city', 'parish'); if (!noAnimation) { if (!Search.$form.hasClass('main-search')) { Search.$form.addClass('main-search'); } Search.$form.removeClass('animate'); setTimeout(function () { Search.$form.addClass('animate'); setTimeout(function () { Search.$form.removeClass('animate'); }, 500); }); } if (dealType < 30) { showGroups.push('change_interest'); } else if (dealType >= 30) { showGroups.push('nr_of_people'); let del; let removeGroups = ['area', 'area_total', 'area_ground', 'structures', 'conditions']; for (var group of removeGroups) { if ((del = showGroups.indexOf(group)) > -1) showGroups.splice(del, 1); } } setTimeout(function () { let $groups = Search.$form.find('[data-group]').not('[data-group="persist"]'); $groups.each(function () { $(this).addClass('hide'); $(this).find('input, select').prop('disabled', true); }); for (var group of showGroups) { let $group = Search.$form.find('[data-group="' + group + '"]'); $group.removeClass('hide'); $group.find('input, select').prop('disabled', false); } }, 250); $('#searchform-extend, #searchform .extended').css('display', (mainDealType === 8 ? 'none' : '')); }, loading: function (loading) { if (loading) { Search.$form.addClass('hide'); if (!Search.$form.parent().find('.loader')) { Search.$form.parent().addClass('loader'); } return; } if (Search.$form.parent().find('.loader')) { Search.$form.parent().find('.loader').remove(); } else { Search.$form.parent().removeClass('loader'); } Search.$form.removeClass('hide'); }, getMainDealType: function (dealType) { if (!searchForm['deal_type']) { return null; } dealType = parseInt(dealType); let mainDealType = dealType; for (var dt of searchForm['deal_type']) { if (dt.includes(dealType)) mainDealType = dt[0]; } return mainDealType; }, removeTag: function (type, name, val, allowSubmit) { if (type === 'select') { if ($('#' + name).length) $('#' + name + '').val('').trigger('change'); else $('select[name="' + name + '"]').val('').trigger('change'); } else if (type === 'selectmulti') { if (val === 'all') { $('#' + name + ' option').prop('selected', false); } else { $('#' + name + ' option[value="' + val + '"]').prop('selected', false); } } else if (type === 'text') { $('#' + name).val(''); } else if (type === 'multitext') { $('#' + name + '_min').val(''); $('#' + name + '_max').val(''); if (name === 'rooms') { $('#rooms_select a').removeClass('active'); } } else if (type === 'check') { if (name === 'company_id1') { $('#' + name).prop('checked', false); $('#company_id').val(''); } else { $('#' + name).prop('checked', false); } } else if (type === 'multicheck') { if (val === 'all') { $('input[name="' + name + '"]').prop('checked', false); } else { $('#' + name).prop('checked', false); } } if (allowSubmit === true) { Search.$form.submit(); } else if (typeof allowSubmit === 'string') { $(allowSubmit).submit(); } }, autosuggestLocations: function (locationIds, onlyChange) { var parts = locationIds.split(','); var prevChanged = false; if (parts[0] && Search.$form.find('[name="county"]').val() !== parts[0]) { Search.$form.find('[name="county"]').val(parts[0]).trigger('change'); prevChanged = true; } if (parts[1]) { if (prevChanged) { Search.tmp_parish_id = parts[1]; } else if (Search.$form.find('[name="parish"]').val() !== parts[1]) { Search.$form.find('[name="parish"]').val(parts[1]).trigger('change'); prevChanged = true; } Search.submitAfter = 'parish'; } if (parts[2] || parts[3]) { var useCityId = parts[3] ? parts[3] : parts[2]; if (prevChanged) { Search.tmp_city_id = useCityId; } else { Search.$form.find('[data-group="city"] input').prop('checked', false); Search.$form.find('#city_' + useCityId).prop('checked', true); } Search.submitAfter = 'city'; } else { Search.$form.find('[data-group="city"] input').prop('checked', false); } if (!onlyChange && Search.submitAfter && !prevChanged) { $('#keyword, .fake-keyword').val(Search.addressKeyword); Search.$form.submit(); delete Search.submitAfter; } else if (onlyChange) { Search.submitAfter = null; } }, checkState: function () { if (MOBILE) { if (PAGE === 'home') { $('header .main-menu').removeClass('hide'); $('#search-outer').addClass('hide'); } else { let $searchOuter = $('#search-outer'); $('header .main-menu').addClass('hide'); if ($searchOuter.hasClass('show')) { $('#searchform .collapse a[data-toggle]').first().click(); log('do click'); } else { $searchOuter.addClass('hide').removeClass('show'); } } $('#short-search').trigger('stateChanged'); } if (!Search.$form.find('.active').data('deal-type') && $.inArray(PAGE, ['search', 'developments']) === -1) { let lastActiveType = Search.getMainDealType(Search.$form.find('[name="deal_type"]').val()); $('header .main-menu a').removeClass('active'); $('header .main-menu a[data-deal-type="' + lastActiveType + '"]').addClass('active'); if (!MOBILE) $('#search-outer').removeClass('hide').removeClass('show'); } if (Search.resetPages.includes(PAGE)) { Search.$form.find('#search-options a').removeClass('hide'); Search.$form.find('#search-options .fa-angle-up').addClass('fa-angle-down').removeClass('fa-angle-up'); Search.$form.find('.extended').removeClass('show').addClass('hide'); Search.$form[0].reset(); Search.$form.find('#bid_objects').val(''); Search.$form.find('#company_id').val(''); Search.$form.find('#broker_id').val(''); Search.$form.find('input[name="orderby"]').val(''); Search.$form.find('.btn-select a').removeClass('active'); Search.$form.find('select').trigger('change'); Search.$form.attr('action', '/search'); $('.main-menu').scrollLeft(0); $('header .main-menu a').first().trigger('click', [false]); Search.$form.find('#short-search').removeClass('hide').trigger('stateChanged'); } if (!MOBILE && Search.openedSearchPages.includes(PAGE)) { $('#search-outer').removeClass('hide').removeClass('show'); Search.$form.find('.collapse').addClass('hide'); } else if (Search.closedSearchPages.includes(PAGE)) { Search.hideSearch(); } Search.urlParams = getUrlParams(realUrl); if (Search.urlParams['deal_type']) { $('.main-menu a').removeClass('active'); $('.main-menu a[data-deal-type="' + Search.getMainDealType(Search.urlParams['deal_type']) + '"]').addClass('active'); } if (Search.urlParams['county']) { Search.autosuggestLocations(Search.locationStr(), true); Search.init(null, Search.$form); } }, goToMobileSearch: function () { if (!$('#search-outer').hasClass('show')) { $('.main-search a[data-toggle]').first().click(); } $(document).scrollTop(0); }, locationStr: function () { return Search.urlParams['county'] + ',' + (typeof Search.urlParams['parish'] != 'undefined' ? Search.urlParams['parish'] : '') + ',' + (Search.urlParams['city'] && Search.urlParams['city'].length ? Search.urlParams['city'].join(',') : '0'); }, hideSearch: function (hideMenu) { $('#search-outer').addClass('hide').removeClass('show'); if (Search.$form.find('.collapse .fa-angle-up').length && Search.$form.find('.collapse a[data-toggle-text]').length) { let $extender = Search.$form.find('.collapse a[data-toggle-text]'); let newText = $extender.data('toggle-text'); newText += ' '; $extender.data('toggle-text', $extender.text()); $extender.html(newText); } Search.$form.find('.collapse').removeClass('hide').find('.fal').addClass('fa-angle-down').removeClass('fa-angle-up'); if (hideMenu && MOBILE) { $('.main-menu,#short-search,#search-outer').addClass('hide'); Search.hideMobileSearch(); } }, hideMobileSearch: function () { $('.main-search div[data-copy-long-search]').each(function () { let copyElem = $($(this).data('copy-long-search')); copyElem.after('

'); $(this).replaceWith(copyElem); }); $('.short-search-city').removeClass('hide'); } };

apartment for sale, 2 rooms - Tööstuse 47a, Kalamaja, Põhja-Tallinn, Tallinn, Harjumaa (2024)
Top Articles
Latest Posts
Article information

Author: Arielle Torp

Last Updated:

Views: 5955

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Arielle Torp

Birthday: 1997-09-20

Address: 87313 Erdman Vista, North Dustinborough, WA 37563

Phone: +97216742823598

Job: Central Technology Officer

Hobby: Taekwondo, Macrame, Foreign language learning, Kite flying, Cooking, Skiing, Computer programming

Introduction: My name is Arielle Torp, I am a comfortable, kind, zealous, lovely, jolly, colorful, adventurous person who loves writing and wants to share my knowledge and understanding with you.