summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/softkeys.js.coffee
blob: 23d5233827a2df5b02baa0dd150e15a54dc07d12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
jQuery ->
  function_name = $('#softkey_softkey_function_id :selected').text()

  if function_name == call_forwarding_function_name
    $('#softkey_call_forward_id').parent().show()
    $('#softkey_number').parent().hide()
  else
    $('#softkey_call_forward_id').parent().hide()
    if (function_name == hold_function_name || function_name == deactivated_function_name)
      $('#softkey_number').parent().hide()
    else
      $('#softkey_number').parent().show()  

  $('#softkey_softkey_function_id').change ->
    $('#softkey_label').parent().show()
    function_name = $('#softkey_softkey_function_id :selected').text()
    if function_name == call_forwarding_function_name
      $('#softkey_call_forward_id').parent().show("slow")
      $('#softkey_number').parent().hide("slow")
    else
      $('#softkey_call_forward_id').parent().hide("slow")
      if (function_name == hold_function_name || function_name == deactivated_function_name)
        $('#softkey_number').parent().hide("slow")
      else
        $('#softkey_number').parent().show("slow")