cron.js 819 B

12345678910111213141516171819
  1. $(document).ready(function(){
  2. $("select[name='homeid_ip_port']").change(function(e){
  3. checkSteamSupportAutoUpdate($(this));
  4. });
  5. checkSteamSupportAutoUpdate($("select[name='homeid_ip_port']").first());
  6. });
  7. function checkSteamSupportAutoUpdate(elem){
  8. var curOpt = $("option:selected", $(elem));
  9. if(curOpt.attr('steam')){
  10. $("option[value='steam_auto_update']", $("select[name='action']", $(elem).parent().prev())).removeAttr('disabled');
  11. }else{
  12. $("option[value='steam_auto_update']", $("select[name='action']", $(elem).parent().prev())).attr('disabled','disabled');
  13. if($("option[value='steam_auto_update']", $("select[name='action']", $(elem).parent().prev())).is(':selected')){
  14. $("select[name='action'] option:enabled:first", $(elem).parent().prev()).prop('selected', 'selected').change();
  15. }
  16. }
  17. }