Projet

Général

Profil

0001-phone-check-aif-call-in-progress-on-loading-page-155.patch

Thomas Noël, 24 mars 2017 11:14

Télécharger (1,33 ko)

Voir les différences:

Subject: [PATCH] phone: check aif call in progress on loading page (#15592)

 welco/static/js/welco.js | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
welco/static/js/welco.js
572 572
              });
573 573
          }
574 574
      }
575

  
576
      /* check current call */
577
      var current_calls_url = $('[data-current-calls]').data('current-calls');
578
      $.ajax({url: current_calls_url,
579
	      dataType: 'json',
580
	      success: function(response) {
581
		  if (response.data.calls.length != 0) {
582
		      /* a call is in progress */
583
		      var caller = response.data.calls[0].caller;
584
		      var zone = $('.source-phone .source [data-zone-url]');
585
		      $.ajax({url: zone.data('zone-url'),
586
			      dataType: 'html',
587
			      success: function(data) {
588
				    $(zone).parent('div').html(data);
589
				    refresh_bottom_cells(function() {
590
					$('.contacts input[name=q]').val(caller).trigger('keyup');
591
				    });
592
			     }
593
		      });
594
		  }
595
	      }
596
      });
597

  
575 598
      window.setTimeout(check_calls, 1000);
576 599
  }
577 600

  
578
-