Ticket #1486099: rc_list_select_first.r3022.patch

File rc_list_select_first.r3022.patch, 1.2 KB (added by JohnDoh, 4 years ago)

allow for "General" to not be the first section in the prefs tab

  • program/js/app.js

    old new  
    351351          this.sections_list.addEventListener('select', function(o){ p.section_select(o); }); 
    352352          this.sections_list.init(); 
    353353          this.sections_list.focus(); 
    354           this.sections_list.select('general');  // open first section by default 
     354          this.sections_list.select_first();  // open first section by default 
    355355        } 
    356356        else if (this.gui_objects.subscriptionlist) 
    357357          this.init_subscription_list(); 
  • program/js/list.js

    old new  
    437437  this.scrollto(id); 
    438438}, 
    439439 
     440/** 
     441 * Select fist fow in table 
     442 */ 
     443select_first: function() 
     444{ 
     445  var rows = this.list.tBodies[0].rows; 
     446  if(rows[0].id && String(rows[0].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) { 
     447    var id = RegExp.$1; 
     448    this.select_row(id, false); 
     449    this.scrollto(id); 
     450  } 
     451}, 
    440452 
    441453/** 
    442454 * Select row next to the last selected one.