Advertisement
DrupalCustom

dashboardJs

Feb 13th, 2012
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    (function$){
  2.    $(document).ready(function () {
  3.       $("#edit-status-list").change(function() {
  4.       var selectedStatus = $(this).find(":selected").text();
  5.       var charExists = ((window.location.href).indexOf('?') >= 0) ? true : false;
  6.      
  7.      if(charExists){
  8.      var split = (window.location.href).split('?');
  9.      var loc = split[0];
  10.      
  11.      loc = loc+"?status="+selectedStatus;  
  12.      self.location.href= loc;
  13.      
  14.      }
  15.      
  16.      else{
  17.       var locf = window.location.href+"?status="+selectedStatus;  
  18.       self.location.href= locf;
  19.      
  20.       }
  21.      
  22.       });
  23.      
  24.       $("#create-freeway-project").submit(function() {
  25.         $(":submit", this).attr("disabled", "disabled");
  26.            
  27.       });
  28.      
  29.      $(".common_link_class").click(function() {
  30.             //alert("Hello");
  31.          
  32.           var count = ($(this).data("clicks") || 0) + 1;
  33.           $(this).data("clicks", count);
  34.          
  35.          
  36.           if ($(this).data("clicks") >= 1) {
  37.          
  38.           }
  39.          
  40.          
  41.           if ($(this).data("clicks") >= 2) {
  42.            
  43.             return false;
  44.           }
  45.         });
  46.        
  47.        
  48.           $("#edit-analysis-code-one").change(function () {
  49.             // Get the configs and split them.
  50.             var cfgs = _get_configs("edit-custRef");
  51.             var split_cfgs = cfgs.split('/');
  52.            
  53.             // Create some new configs and put it back into the configs textfield.
  54.             //var new_cfgs = $(this).val() +"/"+ cfgs[1];
  55.             var new_cfgs = $("#edit-analysis-code-one option:selected").text() +"/"+ cfgs[1];
  56.            
  57.             $("#edit-custRef").val(new_cfgs);
  58.           });
  59.          
  60.           $("#edit-analysis-code-two").change(function () {
  61.             // Get the configs and split them.
  62.             var cfgs = _get_configs("edit-custRef");
  63.             var split_cfgs = cfgs.split('/');
  64.            
  65.             // Create some new configs and put it back into the configs textfield.
  66.             //var new_cfgs = cfgs[0] +"/"+ $(this).val();
  67.             var new_cfgs = cfgs[0] +"/"+ $("#edit-analysis-code-two option:selected").text()
  68.             $("#edit-custRef").val(new_cfgs);
  69.          });
  70.        
  71.    
  72.     });
  73.    
  74. })(jQuery);
  75.  
  76.  
  77. (function$){
  78. function _get_configs(id) {
  79.  
  80.   return $("#"+ id).val();
  81.  
  82. }  
  83. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement