Nikolay Suslov 3 жил өмнө
parent
commit
310cb3979a

+ 1 - 1
public/defaults/worlds/aframe-ar/index.vwf.json

@@ -124,7 +124,7 @@
           },
           "methods": {
             "run": {
-              "body": "    var time = this.time;\n    let rot = this.rotation; //AFRAME.utils.coordinates.parse(this.rotation);\n    this.rotation = [rot[0], rot[1]+2, rot[2]];\n    this.future( 0.05 ).run();\n",
+              "body": "    var time = this.time;\n    let rot = this.rotation; //AFRAME.utils.coordinates.parse(this.rotation);\n    this.rotation = [rot.x, rot.y+2, rot.z];\n    this.future( 0.05 ).run();\n",
               "type": "application/javascript"
             }
           },

+ 42 - 32
public/lib/ui/widgets.js

@@ -995,9 +995,8 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                       this._switch.checked = JSON.parse(config).webrtc;
                       
                      // this._replaceSwitch = this._switch;
-                      
-                    },
-                    'onchange': function (e) {
+                     this.addEventListener('change',
+                     function (e) {
     
                         if (this._switch) {
                             let chkAttr = this._switch.checked;//this.getAttribute('checked');
@@ -1013,6 +1012,11 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                             }
                         }
                     }
+                     
+                     )
+                      
+                    },
+                    'onchange': ""
                   }
                   ),
                   {
@@ -1043,11 +1047,8 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                       this._switch = new mdc.switchControl.MDCSwitch(this);
                       let config = localStorage.getItem('lcs_config');
                       this._switch.checked = JSON.parse(config).streamMsg;
-                      
-                     // this._replaceSwitch = this._switch;
-                      
-                    },
-                    'onchange': function (e) {
+                      this.addEventListener('change',
+                      function (e) {
     
                         if (this._switch) {
                             let chkAttr = this._switch.checked;//this.getAttribute('checked');
@@ -1063,6 +1064,11 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                             }
                         }
                     }
+                      )
+                     // this._replaceSwitch = this._switch;
+                      
+                    },
+                    'onchange': ""
                   }
                   ),
                   {
@@ -1091,11 +1097,8 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                       this._switch = new mdc.switchControl.MDCSwitch(this);
                       let config = localStorage.getItem('lcs_config');
                       this._switch.checked = JSON.parse(config).multisocket;
-                      
-                     // this._replaceSwitch = this._switch;
-                      
-                    },
-                    'onchange': function (e) {
+                      this.addEventListener('change',
+                      function (e) {
     
                         if (this._switch) {
                             let chkAttr = this._switch.checked;//this.getAttribute('checked');
@@ -1111,6 +1114,11 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                             }
                         }
                     }
+                      )
+                     // this._replaceSwitch = this._switch;
+                      
+                    },
+                    'onchange': ""
                   }
                   ),
                   {
@@ -1190,26 +1198,29 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
                             this._switch.checked = JSON.parse(config).luminary;
     
                             // this._replaceSwitch = this._switch;
+                            this.addEventListener('change',
+                            function (e) {
     
-                        },
-                        'onchange': function (e) {
-    
-                            if (this._switch) {
-                                let chkAttr = this._switch.checked;//this.getAttribute('checked');
-                                if (chkAttr) {
-                                    let config = JSON.parse(localStorage.getItem('lcs_config'));
-                                    config.luminary = true;
-                                    localStorage.setItem('lcs_config', JSON.stringify(config));
-                                    window.location.reload(true);
-                                    //this._switch.checked = false;
-                                } else {
-                                    let config = JSON.parse(localStorage.getItem('lcs_config'));
-                                    config.luminary = false;
-                                    localStorage.setItem('lcs_config', JSON.stringify(config));
-                                    window.location.reload(true);
+                                if (this._switch) {
+                                    let chkAttr = this._switch.checked;//this.getAttribute('checked');
+                                    if (chkAttr) {
+                                        let config = JSON.parse(localStorage.getItem('lcs_config'));
+                                        config.luminary = true;
+                                        localStorage.setItem('lcs_config', JSON.stringify(config));
+                                        window.location.reload(true);
+                                        //this._switch.checked = false;
+                                    } else {
+                                        let config = JSON.parse(localStorage.getItem('lcs_config'));
+                                        config.luminary = false;
+                                        localStorage.setItem('lcs_config', JSON.stringify(config));
+                                        window.location.reload(true);
+                                    }
                                 }
                             }
-                        }
+                            )
+    
+                        },
+                        'onchange': ""
                     }
                     ),
                     {
@@ -1648,5 +1659,4 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
 
       }
 
-   export { Widgets }
-
+   export { Widgets }