1242: Убрать поле при регистрации

фикс Модалка подписки на новости - перебила модалку
remotes/origin/top_year_choice
Alexander Burdeiny 10 years ago
parent eab81dd0ac
commit b9710b5d53
  1. 10
      static/client/js/_modules/block.registration.completion.js
  2. 2
      static/client/js_min/_modules/block.registration.completion.min.js
  3. 11
      templates/client/popups/announce_subscription.html

@ -116,7 +116,7 @@ if (EXPO.registration.completion) {
});
window.reg_opened = window.reg_opened || false
$.fancybox.open([
{
href: '#end-reg'
@ -134,7 +134,13 @@ if (EXPO.registration.completion) {
keys: {
// prevents closing when press ESC button
close: null
}
},
afterClose: function() {
window.reg_opened = false;
},
beforeShow: function() {
window.reg_opened = true;
},
});

@ -1 +1 @@
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var t={},e=function(t){var e=$("#end-reg"),i="pwf-line",o=EXPO.common.opt.activeClass,n="phone",r="label",a=EXPO.common.opt.errMessageClass;if($("."+a,e).removeClass(o),t.success)location=t.redirect;else{console.log(t);for(var s in t.errors)t.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+i),$("."+a,$itemWrap).addClass(o).text(t.errors[s][0]),$itemWrap.hasClass(n)&&$("."+r,$itemWrap).hide())}},i=function(t){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:t}).on("change",function(){var t=$("option:selected",this).attr("data-phone-code");""!=$.trim(t)?$("#id_code_country").select2("val",t):$("#id_code_country").select2("val","")}),$("#id_city").select2({placeholder:"Ваш город",width:t,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(t,e,i){var i=$("#id_country").val();return{term:t,page:e,country:i}},results:function(t){var e=[];return $.each(t,function(t,i){e.push({id:i.id,text:i.label})}),{results:e}}},initSelection:function(t,e){var i=$(t).val(),o=$(t).attr("data-init-text");e({id:i,text:o})}})};t.opt={};EXPO.common;return $(function(){var t=$("#end-reg-form");$("body").addClass("body-fixed"),i("100%"),$("#id_code_country").val("7").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),t.on("submit",function(t){t.preventDefault();var i=$(this).attr("action"),o=$(this).serialize();$.post(i,o,e)}),$(".url-field:not(.err) input",t).focusin(function(){$(this).parent().siblings(".hint-box").fadeIn()}),$(".url-field:not(err) input",t).focusout(function(){$(this).parent().siblings(".hint-box").fadeOut()})}),t.init=function(t){$.extend(this.opt,t)},t}();
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var e={},t=function(e){var t=$("#end-reg"),o="pwf-line",n=EXPO.common.opt.activeClass,i="phone",r="label",a=EXPO.common.opt.errMessageClass;if($("."+a,t).removeClass(n),e.success)location=e.redirect;else{console.log(e);for(var s in e.errors)e.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+o),$("."+a,$itemWrap).addClass(n).text(e.errors[s][0]),$itemWrap.hasClass(i)&&$("."+r,$itemWrap).hide())}},o=function(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}).on("change",function(){var e=$("option:selected",this).attr("data-phone-code");""!=$.trim(e)?$("#id_code_country").select2("val",e):$("#id_code_country").select2("val","")}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,o){var o=$("#id_country").val();return{term:e,page:t,country:o}},results:function(e){var t=[];return $.each(e,function(e,o){t.push({id:o.id,text:o.label})}),{results:t}}},initSelection:function(e,t){var o=$(e).val(),n=$(e).attr("data-init-text");t({id:o,text:n})}})};e.opt={};EXPO.common;return $(function(){var e=$("#end-reg-form");$("body").addClass("body-fixed"),o("100%"),$("#id_code_country").val("7").select2({width:"95px"}),window.reg_opened=window.reg_opened||!1,$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null},afterClose:function(){window.reg_opened=!1},beforeShow:function(){window.reg_opened=!0}}),e.on("submit",function(e){e.preventDefault();var o=$(this).attr("action"),n=$(this).serialize();$.post(o,n,t)}),$(".url-field:not(.err) input",e).focusin(function(){$(this).parent().siblings(".hint-box").fadeIn()}),$(".url-field:not(err) input",e).focusout(function(){$(this).parent().siblings(".hint-box").fadeOut()})}),e.init=function(e){$.extend(this.opt,e)},e}();

@ -63,8 +63,13 @@
$(function() {
window.reg_opened = window.reg_opened || false
setTimeout(function(){
function open_func() {
if (window.reg_opened) {
setTimeout(open_func, 1000);
return;
}
setCookie('subscribe_popup', '1', 30);
$.ajax({
url:'/newsletters/tracking/newsletter/count-popup/',
@ -78,7 +83,9 @@
[{href: '#pw-subscribe-popup'}],
{}
);
}, 1000);
}
setTimeout(open_func, 1000);
});
</script>

Loading…
Cancel
Save