Commit added014433ffb878c3eff29caa47d27b47b2794

Authored by Hayk Nazaryan
1 parent e231adb4d5
Exists in master

fixes

Showing 3 changed files with 29 additions and 19 deletions Side-by-side Diff

resources/views/js/modals.blade.php
... ... @@ -102,6 +102,7 @@
102 102 $('#block-info').hide();
103 103 $('#messages_error_reg').html('');
104 104  
  105 + $.fancybox.close(true);
105 106 $.fancybox.open({
106 107 src: '#successful-registration-worker',
107 108 type: 'inline',
... ... @@ -126,6 +127,7 @@
126 127 $('#block-info').hide();
127 128 $('#messages_error_reg').html('');
128 129  
  130 + $.fancybox.close(true);
129 131 $.fancybox.open({
130 132 src: '#successful-registration-employer',
131 133 type: 'inline',
... ... @@ -183,12 +185,16 @@
183 185 $('.error-message').text('');
184 186  
185 187 let formData = $(this).serialize();
186   -
  188 + const btnElm = $('#button_reg_worker')
187 189 $.ajax({
188 190 url: $(this).attr('action'),
189 191 method: $(this).attr('method'),
190 192 data: formData,
  193 + beforeSend() {
  194 + btnElm.attr('disabled', true)
  195 + },
191 196 success: function (response) {
  197 + btnElm.attr('disabled', false)
192 198 if (response.REDIRECT) {
193 199 successfulRegistrationWorker()
194 200 }
... ... @@ -232,17 +238,23 @@
232 238 $('.employer_error-message').text('');
233 239  
234 240 let formData = $(this).serialize();
  241 + const btnElm = $('#button_reg_employer')
235 242  
236 243 $.ajax({
237 244 url: $(this).attr('action'),
238 245 method: $(this).attr('method'),
239 246 data: formData,
  247 + beforeSend() {
  248 + btnElm.attr('disabled', true)
  249 + },
240 250 success: function (response) {
  251 + btnElm.attr('disabled', false)
241 252 if (response.REDIRECT) {
242 253 successfulRegistrationEmployer();
243 254 }
244 255 },
245 256 error: function (jqXHR) {
  257 + btnElm.attr('disabled', false)
246 258 if (jqXHR.status === 422) {
247 259 let errors = jqXHR.responseJSON.ERRORS;
248 260  
resources/views/layout/frontend.blade.php
... ... @@ -350,30 +350,21 @@
350 350 @if(App::isProduction())
351 351 <!-- Yandex.Metrika counter -->
352 352 <script type="text/javascript" >
353   - (function(m, e, t, r, i, k, a) {
354   - m[i] = m[i] || function() {
355   - (m[i].a = m[i].a || []).push(arguments);
356   - };
357   - m[i].l = 1 * new Date();
358   - for (var j = 0; j < document.scripts.length; j++) {
359   - if (document.scripts[j].src === r) {
360   - return;
361   - }
362   - }
363   - k = e.createElement(t), a = e.getElementsByTagName(t)[0];
364   - k.async = 1;
365   - k.src = r;
366   - a.parentNode.insertBefore(k, a);
367   - })(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
  353 + (function(m,e,t,r,i,k,a){m[i]=m[i]function(){(m[i].a=m[i].a[]).push(arguments)};
  354 + m[i].l=1*new Date();
  355 + for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
  356 + k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
  357 + (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
368 358  
369   - ym(98897513, "init", {
  359 + ym(99323269, "init", {
370 360 clickmap:true,
371 361 trackLinks:true,
372 362 accurateTrackBounce:true,
373 363 webvisor:true
374 364 });
375 365 </script>
376   - <noscript><div><img src="https://mc.yandex.ru/watch/98897513" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
  366 + <noscript><div><img src="https://mc.yandex.ru/watch/99323269" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
  367 +
377 368 <!-- /Yandex.Metrika counter -->
378 369 @endif
379 370 </body>
resources/views/modals/reset_password.blade.php
... ... @@ -22,19 +22,26 @@
22 22 <script>
23 23 $(document).on('click', '#reset-password-btn', function (e) {
24 24 e.preventDefault();
  25 + const btnElm = $(this)
25 26 const form = $('#reset-password-form');
26 27 $.ajax({
27 28 url: form.attr('action'),
28 29 method: form.attr('method'),
29 30 data: form.serialize(),
  31 + beforeSend() {
  32 + btnElm.attr('disabled', true)
  33 + },
30 34 success: function (response) {
  35 + btnElm.attr('disabled', false)
  36 + $.fancybox.close(true);
31 37 $.fancybox.open({
32   - src: '#sign',
  38 + src: '#reset-password-sent',
33 39 type: 'inline',
34 40 opts: {touch: false}
35 41 });
36 42 },
37 43 error: function (jqXHR) {
  44 + btnElm.attr('disabled', false)
38 45 if (jqXHR.status === 422) {
39 46 let errors = jqXHR.responseJSON.errors;
40 47 for (let field in errors) {