From 0747520df3f9920507e3c71931df4089395f25f2 Mon Sep 17 00:00:00 2001 From: fefa4ka Date: Thu, 31 Mar 2016 15:28:43 +0300 Subject: [PATCH] fix region detection --- zsite/static/js/snippets.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zsite/static/js/snippets.js b/zsite/static/js/snippets.js index ab8ab5b..c3da839 100644 --- a/zsite/static/js/snippets.js +++ b/zsite/static/js/snippets.js @@ -55,20 +55,23 @@ detectRegion = function() { 'city': 'В Ростове-на-Дону', 'phone': '+7 863 209-85-65' }, - 'Volgogradskaya Oblast': { + 'Stavropol\'skiy Kray': { 'city': 'В Ростове-на-Дону', 'phone': '+7 863 209-85-65' }, 'Voronezhskaya Oblast': { - 'city': 'В Ростове-на-Дону', - 'phone': '+7 863 209-85-65' + 'city': 'В Воронеже', + 'phone': '+7 800 700-16-37' + }, + 'Volgogradskaya Oblast': { + 'city': 'В Волгограде', + 'phone': '+7 800 700-16-37' } }; console.log(current_region); if(typeof current_region !== "undefined") { - $('.city').text(regions[current_region]['city']); $('.header-contacts .consultation h3').text(regions[current_region]['phone']); } @@ -76,7 +79,7 @@ detectRegion = function() { } - if(typeof getCookie('region') === undefined || getCookie('region') == "") { + if(typeof getCookie('region') === "undefined" || getCookie('region') == "") { var request = $.get('http://ip-api.com/json') request.done(function(data) {