fix incorrect Javascript private variable style

It's supposed to be a trailing underscore, not a leading underscore, as
described here:

https://google.github.io/styleguide/jsguide.html#naming-method-names
https://google.github.io/styleguide/jsguide.html#naming-non-constant-field-names

and discussed in an earlier PR:

https://github.com/scottlamb/moonfire-nvr/pull/48#discussion_r175678736

I fixed these mechanically:

rg -l0 'this[.]_' | xargs -0 perl -pi -e 's/this[.]_(\w+)/this.$1_/g'
rg -l0 '\s_\w+\(' | xargs -0 perl -pi -e 's/_(\w+)\(/$1_(/g'
This commit is contained in:
Scott Lamb
2020-03-14 15:20:18 -07:00
parent 038aebe0fd
commit 9d6dec2565
13 changed files with 223 additions and 223 deletions

View File

@@ -60,7 +60,7 @@ export default class StreamView {
trimmed,
recordingsParent
);
this._enabled = true;
this.enabled_ = true;
this.recordingsUrl = null;
this.recordingsReq = null;
}
@@ -71,7 +71,7 @@ export default class StreamView {
* @return {Boolean}
*/
get enabled() {
return this._enabled;
return this.enabled_;
}
/**
@@ -80,7 +80,7 @@ export default class StreamView {
* @param {Boolean} enabled Whether view should be enabled
*/
set enabled(enabled) {
this._enabled = enabled;
this.enabled_ = enabled;
this.recordingsView.show = enabled;
console.log('Stream %s-%s %s', this.camera.shortName, this.streamType,
this.enabled ? 'enabled' : 'disabled');