', { html: o.PresidentFirstLine }) .append(thisclass.OrganizationsClassId == 4 || thisclass.OrganizationsClassId == 5 ? $('
', { html: o.TextFirstLine }) : '') )) ) } $('div.results-list .results-table').append(div); $('.org-results .results-table').masonry().masonry('appended', div); } } thisclass.ResultsListInit(); if (thisclass.OrganizationsSearchCount > thisclass.OrganizationsSearch.length) $('#button-open').show(); } }); } }, TextClickOnLink: function () { $(".org-block .org-description a").unbind('click'); $(".org-block .org-description a").click(function () { if ($(this).attr('href') && $(this).attr('href').indexOf('/person/') > -1) { ISPerson.TextClickOnLink($(this)); return false; } return true; }); $("tr#president td a, .scroll-wrap.org-description-full a").unbind('click'); $("tr#president td a, .scroll-wrap.org-description-full a").click(function () { if ($(this).attr('href') && $(this).attr('href').indexOf('/person/') > -1) { ISPerson.TextClickOnLink($(this)); return false; } return true; }); }, OrgPopupToggle: function (el) { this.HidePopup(); var thisclass = this; if (thisclass.OrganizationsSearchById[el.data('orgid')] != undefined) thisclass.SetOrgPopupToggle(this.OrganizationsSearch[thisclass.OrganizationsSearchById[el.data('orgid')]]); else if (thisclass.OrganizationsLastById[el.data('orgid')] != undefined) thisclass.SetOrgPopupToggle(this.OrganizationsLast[thisclass.OrganizationsLastById[el.data('orgid')]]); else if (thisclass.OrganizationsTempById[el.data('orgid')] != undefined) thisclass.SetOrgPopupToggle(this.OrganizationsTemp[thisclass.OrganizationsTempById[el.data('orgid')]]); else { $.ajax({ async: false, url: "/ajax/organizationsforsearch?v=" + ISCommon.GetV(), data: { OrganizationsIdsString: JSON.stringify([el.data('orgid')]) }, success: function (d) { thisclass.OrganizationsTemp = d.OrganizationsSearch; for (var i = 0; i < d.OrganizationsSearch.length; i++) thisclass.OrganizationsTempById[d.OrganizationsSearch[i].Id] = i; thisclass.SetOrgPopupToggle(thisclass.OrganizationsTemp[thisclass.OrganizationsTempById[el.data('orgid')]]); } }); } this.ShowPopup(el.data('orgid')); }, ShowPopup: function (orgid) { thisclass = this; var popup = $(".org-popup"), bg = $(".org-popup-bg"), cont = popup.find('.org-content'); var offsetik = $(window).scrollTop(); var newWidth = ($("#container").width() < 1000) ? $("#container").width() : 1000, newHeight = $(".org-wrap").outerHeight(true) - $(".filter-wrap").outerHeight(true) - $(".results-count").outerHeight(true); bg.css({ top: 0, height: $(document).outerHeight() }); popup.css({ top: offsetik, width: newWidth, marginLeft: 0 - (newWidth / 2) }); bg.show(); popup.show(); bg.unbind('click'); bg.click(function () { popup.find(".close").click(); }); popup.find(".close").unbind('click'); popup.find(".close").click(function () { popup.hide(); bg.hide(); if (thisclass.History) { if (this.Type == "Industry") ISHistory.Push({ id: orgid, type: 'organizations', action: 'close' }, 'Организации спортивной индустрии', thisclass.UrlPage); else if (this.Type == "Regional") ISHistory.Push({ id: orgid, type: 'organizations', action: 'close' }, 'Региональные спортивные организации', thisclass.UrlPage); else ISHistory.Push({ id: orgid, type: 'organizations', action: 'close' }, 'Всероссийские спортивные организации', thisclass.UrlPage); } return false; }); }, HidePopup: function () { var popup = $(".org-popup"), bg = $(".org-popup-bg"), cont = popup.find('.org-content'); if (bg.is(':visible') || popup.is(':visible')) { popup.hide(); bg.hide(); } }, SetOrgPopupToggle: function (o) { if (this.History) { if (this.Type == "International") ISHistory.Push({ id: o.Id, type: 'organizations', action: 'open' }, o.Name, '/organizationsinternational/' + o.Alias); else if (this.Type == "OfForeignCountries") ISHistory.Push({ id: o.Id, type: 'organizations', action: 'open' }, o.Name, '/organizationsofforeigncountries/' + o.Alias); else if (this.Type == "Industry") ISHistory.Push({ id: o.Id, type: 'organizations', action: 'open' }, o.Name, '/organizationsindustry/' + o.Alias); else if (this.Type == "Regional") ISHistory.Push({ id: o.Id, type: 'organizations', action: 'open' }, o.Name, '/organizationsregional/' + o.Alias); else ISHistory.Push({ id: o.Id, type: 'organizations', action: 'open' }, o.Name, '/organizations/' + o.Alias); } $('.org-popup #edit-organization').data('organizationid', o.Id); $('.org-popup #edit-organization').attr('data-organizationid', o.Id); $('.org-popup .wrapper .heading .sport-list').html(''); if (o.TAFCList && o.TAFCList.length > 0) { $('.org-popup .wrapper .heading .sport-list').addClass('adaptive'); for (var i = 0; i < o.TAFCList.length; i++) { var urlotafc = "/organizationsregional?organizationstypesid=" + o.OrganizationsTypesId + "&otafcid=" + o.TAFCList[i].Id; $('.org-popup .wrapper .heading .sport-list') .append( $('