Commit 36d5fba588c12e57bfc8b80b8e50a39d56d6d955

Authored by Eugeny Galkovskiy
2 parents b1cbf08d c0ec8ed2

Merge branch 'popup' of gitlab.artweb.com.ua:Alex/semena

src/app/frontend/views/index.php
@@ -245,9 +245,6 @@ $page_title = isset( $page_title ) && !empty( $page_title ) ? $page_title : ''; @@ -245,9 +245,6 @@ $page_title = isset( $page_title ) && !empty( $page_title ) ? $page_title : '';
245 </div> 245 </div>
246 </div> 246 </div>
247 247
248 -<div class="open-delivery-modal hidden_modal">  
249 - <div><img src="/images/popup_full.png" class="popup_full"><img src="/images/popup_open.png" class="popup_mobile"><span class="modal_close"></span></div>  
250 -</div>  
251 <div class="delivery-form-par"> 248 <div class="delivery-form-par">
252 <div class="close-white"></div> 249 <div class="close-white"></div>
253 <div class="popup-main-delivery"> 250 <div class="popup-main-delivery">
@@ -269,29 +266,6 @@ $page_title = isset( $page_title ) &amp;&amp; !empty( $page_title ) ? $page_title : &#39;&#39;; @@ -269,29 +266,6 @@ $page_title = isset( $page_title ) &amp;&amp; !empty( $page_title ) ? $page_title : &#39;&#39;;
269 </div> 266 </div>
270 </div> 267 </div>
271 268
272 -<script>  
273 - $(document).ready(function(){  
274 - setTimeout(function(){$(".open-delivery-modal").show();},1000);  
275 - });  
276 - $(".open-delivery-modal div img").click(function(){  
277 - $(".delivery-form-par").show();  
278 - $(".delivery-form-par").animate({opacity: "1"}, 500, function() {});  
279 - $(".delivery-form-par .popup-main-delivery").animate({opacity: "1",top: "15%"}, 300, function() {});  
280 - });  
281 - $(".delivery-form-par .close-white").click(function(){  
282 - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {});  
283 - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {});  
284 - setTimeout(function(){$(".delivery-form-par").hide();}, 600);  
285 - });  
286 - $(".delivery-form-par .close-popup").click(function(){  
287 - $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {});  
288 - $(".delivery-form-par").animate({opacity: "0"}, 500, function() {});  
289 - setTimeout(function(){$(".delivery-form-par").hide();}, 600);  
290 - });  
291 - $(".modal_close").click(function(){  
292 - $(".open-delivery-modal").hide();  
293 - });  
294 -</script>  
295 <?php 269 <?php
296 if( !IS_PRODUCTION ) 270 if( !IS_PRODUCTION )
297 { 271 {
src/app/frontend/views/page/index.php
@@ -321,6 +321,53 @@ js, fjs); @@ -321,6 +321,53 @@ js, fjs);
321 321
322 </div> 322 </div>
323 323
  324 +<!-- popup button -->
  325 +<div class="open-delivery-modal hidden_modal">
  326 + <div><img src="/images/popup_full.png" class="popup_full"><img src="/images/popup_open.png" class="popup_mobile"><span class="modal_close"></span></div>
  327 +</div>
  328 +<!-- popup button -->
  329 +
  330 +<!-- popup js -->
  331 +<script>
  332 + $(document).ready(function(){
  333 + function getCookie(a) {
  334 + var b = new RegExp(a+'=([^;]){1,}');
  335 + var c = b.exec(document.cookie);
  336 + if(c) c = c[0].split('=');
  337 + else return false;
  338 + return c[1] ? c[1] : false;
  339 + }
  340 + var cookie = getCookie('popup');
  341 + if (cookie !== '1') {
  342 + setTimeout(function(){$(".open-delivery-modal").show();},1000);
  343 + }
  344 + else {
  345 + $(".open-delivery-modal").hide();
  346 + }
  347 +
  348 + $(".open-delivery-modal div img").click(function(){
  349 + $(".delivery-form-par").show();
  350 + $(".delivery-form-par").animate({opacity: "1"}, 500, function() {});
  351 + $(".delivery-form-par .popup-main-delivery").animate({opacity: "1",top: "15%"}, 300, function() {});
  352 + });
  353 + $(".delivery-form-par .close-white").click(function(){
  354 + $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {});
  355 + $(".delivery-form-par").animate({opacity: "0"}, 500, function() {});
  356 + setTimeout(function(){$(".delivery-form-par").hide();}, 600);
  357 + });
  358 + $(".delivery-form-par .close-popup").click(function(){
  359 + $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {});
  360 + $(".delivery-form-par").animate({opacity: "0"}, 500, function() {});
  361 + setTimeout(function(){$(".delivery-form-par").hide();}, 600);
  362 + });
  363 + $(".modal_close").click(function(){
  364 + $(".open-delivery-modal").hide();
  365 + });
  366 + });
  367 +
  368 +</script>
  369 +<!-- popup button -->
  370 +
324 <script> 371 <script>
325 $(document).ready(function() { 372 $(document).ready(function() {
326 <?php foreach($active_sales as $k => $sale): ?> 373 <?php foreach($active_sales as $k => $sale): ?>