@ -983,8 +983,7 @@ function addSchedule(event) {
var type = ( 1 === event . data . schType ) ? "switch" : "light" ;
var type = ( 1 === event . data . schType ) ? "switch" : "light" ;
template = $ ( "#" + type + "ActionTemplate" ) . children ( ) ;
template = $ ( "#" + type + "ActionTemplate" ) . children ( ) ;
var actionLine = template . clone ( ) ;
$ ( line ) . find ( "#schActionDiv" ) . append ( actionLine ) ;
$ ( line ) . find ( "#schActionDiv" ) . append ( template . clone ( ) ) ;
$ ( line ) . find ( "input" ) . each ( function ( ) {
$ ( line ) . find ( "input" ) . each ( function ( ) {
$ ( this ) . attr ( "tabindex" , tabindex ) ;
$ ( this ) . attr ( "tabindex" , tabindex ) ;
@ -1028,10 +1027,6 @@ function initRelays(data) {
$ ( "label.toggle" , line ) . prop ( "for" , "relay" + i )
$ ( "label.toggle" , line ) . prop ( "for" , "relay" + i )
line . appendTo ( "#relays" ) ;
line . appendTo ( "#relays" ) ;
// Populate the relay SELECTs
$ ( "select.isrelay" ) . append (
$ ( "<option></option>" ) . attr ( "value" , i ) . text ( "Switch #" + i ) ) ;
}
}
}
}
@ -1096,6 +1091,11 @@ function initRelayConfig(data) {
}
}
line . appendTo ( "#relayConfig" ) ;
line . appendTo ( "#relayConfig" ) ;
// Populate the relay SELECTs
$ ( "select.isrelay" ) . append (
$ ( "<option></option>" ) . attr ( "value" , i ) . text ( "Switch #" + i ) ) ;
}
}
}
}