src/Builder4/PopoverProperty.bjs
authorAlan <alan@roojs.com>
Thu, 9 Jun 2022 06:04:48 +0000 (14:04 +0800)
committerAlan <alan@roojs.com>
Thu, 9 Jun 2022 06:04:48 +0000 (14:04 +0800)
src/Builder4/PopoverProperty.vala

src/Builder4/PopoverProperty.bjs
src/Builder4/PopoverProperty.vala

index decad8e..bba4306 100644 (file)
            "\t// since we can't add listeners?!?!?",
            "\t// only check props.",
            "\t// check if property already exists in node.\t",
+           "\tvar prop = _this.prop;",
            "\tif (_this.node.props.has_key(prop.to_index_key())) {",
            "\t\t_this.error.setError(\"Property already exists\");",
            "\t\treturn;\t",
            "\t}",
            "\t// add it, ",
-           "\tvar prop = _this.prop;",
+           "\t",
            "\t_this.node.set_prop(prop);",
            "\t_this.is_new = false;\t",
            "\t_this.mainwindow.windowstate.left_props.reload();",
index 1d54afd..641c074 100644 (file)
@@ -727,12 +727,13 @@ public class Xcls_PopoverProperty : Object
                // since we can't add listeners?!?!?
                // only check props.
                // check if property already exists in node.    
+               var prop = _this.prop;
                if (_this.node.props.has_key(prop.to_index_key())) {
                        _this.error.setError("Property already exists");
                        return; 
                }
                // add it, 
-               var prop = _this.prop;
+               
                _this.node.set_prop(prop);
                _this.is_new = false;   
                _this.mainwindow.windowstate.left_props.reload();