diff --git a/app/assets/javascripts/app/controllers/cti.coffee b/app/assets/javascripts/app/controllers/cti.coffee index 7132ad50b..46029c79b 100644 --- a/app/assets/javascripts/app/controllers/cti.coffee +++ b/app/assets/javascripts/app/controllers/cti.coffee @@ -142,7 +142,7 @@ class App.CTI extends App.Controller for item in @list item.status_class = '' - + item.disabled = true if item.state is 'newCall' item.state_human = 'ringing' item.status_class = 'neutral' @@ -150,6 +150,7 @@ class App.CTI extends App.Controller item.state_human = 'connected' item.status_class = 'ok' else if item.state is 'hangup' + item.disabled = false item.state_human = switch item.comment when 'cancel', 'noAnswer', 'congestion' then 'not reached' when 'busy' then 'busy' @@ -164,6 +165,10 @@ class App.CTI extends App.Controller if item.start && item.end item.duration = format((Date.parse(item.end) - Date.parse(item.start))/1000) + diff_in_min = ((Date.now() - Date.parse(item.created_at)) / 1000) / 60 + if diff_in_min > 1 + item.disabled = false + @userPopupsDestroy() @callerLog.html( App.view('cti/caller_log')(list: @list)) @userPopups() diff --git a/app/assets/javascripts/app/views/cti/caller_log.jst.eco b/app/assets/javascripts/app/views/cti/caller_log.jst.eco index a4552fff8..b5faa1a7f 100644 --- a/app/assets/javascripts/app/views/cti/caller_log.jst.eco +++ b/app/assets/javascripts/app/views/cti/caller_log.jst.eco @@ -11,10 +11,10 @@ <% for item in @list: %> - class="is-grayed-out"<% end %> data-id="<%- item.id %>"> + class="is-grayed-out"<% end %> data-id="<%- item.id %>"> -