Changeset 13842

Show
Ignore:
Timestamp:
03/15/12 08:34:51 (1 year ago)
Author:
mbrevda
Message:

closes #5647 - allow blank id to be a 'unique' destiantion identifier

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.10/amp_conf/htdocs/admin/assets/js/script.legacy.js

    r13481 r13842  
    523523  //destination double dropdown code 
    524524  $('.destdropdown').unbind().bind('blur click change keypress', function(){ 
    525     var name=$(this).attr('name'); 
    526     var id=name.replace('goto',''); 
    527     var dest=$(this).val(); 
    528     $('[name$='+id+'].destdropdown2').hide(); 
    529     $('[name='+dest+id+'].destdropdown2').show(); 
     525    var name  = $(this).attr('name'); 
     526    var id    = $(this).data('id'); 
     527    var id    = typeof id == 'undefined' ? '' : id;//ensure id isnt set to undefined 
     528    var dest  = $(this).val(); 
     529    $('[data-id=' + id + '].destdropdown2').hide(); 
     530    $('[name=' + dest + id + '].destdropdown2').show(); 
    530531  }); 
    531532   
  • freepbx/branches/2.10/amp_conf/htdocs/admin/helpers/freepbx_helpers.php

    r12995 r13842  
    9191  $style=' style="'.(($destmod=='Error')?'background-color:red;':'background-color:white;').'"'; 
    9292  $html.='<select name="goto'.$i.'" class="destdropdown" '.$style.' tabindex="'.++$tabindex.'"' 
    93       . ($required ? ' required ' : '') . '>';//html5 validation 
     93      . ($required ? ' required ' : '') //html5 validation 
     94      . ' data-id="' . $i . '" ' 
     95      . '>'; 
    9496  $html.='<option value="" style="background-color:white;">'.$nodest_msg.'</option>'; 
    9597  foreach($drawselects_module_hash as $mod => $disc){ 
     
    110112    if($cat=='Error'){$style.=' '.$errorstyle;}//add error style 
    111113    $style=' style="'.(($cat=='Error')?'background-color:red;':$style).'"'; 
    112     $html.='<select name="'.str_replace(' ','_',$cat).$i.'" '.$tabindexhtml.$style.' class="destdropdown2">'; 
     114    $html.='<select name="'.str_replace(' ','_',$cat).$i.'" '.$tabindexhtml.$style.' class="destdropdown2"' 
     115        . ' data-id="' . $i . '" ' 
     116        . '>'; 
    113117    foreach($destination as $dest){ 
    114118      $selected=($goto==$dest['destination'])?'SELECTED ':' ';