Merge branch 'master' into new-schema

This commit is contained in:
Scott Lamb
2020-07-12 19:22:38 -07:00
10 changed files with 101 additions and 49 deletions

View File

@@ -84,11 +84,11 @@ export default class NVRSettingsView {
*/
wireControls_() {
const videoLengthEl = $(`#${this.ids_.videoLenId}`);
this.videoLength_ = this.findSelectedOrFirst_(videoLengthEl);
const normalize = (v) => v == 'infinite' ? Infinity : Number(v);
this.videoLength_ = normalize(this.findSelectedOrFirst_(videoLengthEl));
videoLengthEl.change((e) => {
const newValueStr = e.currentTarget.value;
this.videoLength_ =
newValueStr == 'infinite' ? Infinity : Number(newValueStr);
this.videoLength_ = normalize(e.currentTarget.value);
if (this.videoLengthHandler_) {
this.videoLengthHandler_(this.videoLength_);
}