Do truthy check in if block
authorKevin Sawicki <kevinsawicki@gmail.com>
Thu, 3 Nov 2016 18:37:11 +0000 (11:37 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 7 Nov 2016 16:25:01 +0000 (08:25 -0800)
lib/renderer/web-view/web-view-attributes.js

index 51814b7..f42fcc5 100644 (file)
@@ -66,10 +66,10 @@ class BooleanAttribute extends WebViewAttribute {
   }
 
   setValue (value) {
-    if (!value) {
-      this.webViewImpl.webviewNode.removeAttribute(this.name)
-    } else {
+    if (value) {
       this.webViewImpl.webviewNode.setAttribute(this.name, '')
+    } else {
+      this.webViewImpl.webviewNode.removeAttribute(this.name)
     }
   }
 }