@dualbox/editor 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/html/editor.html +0 -29
- package/js/dist/GraphEditor.js +8 -2
- package/js/src/GraphEditor.js +6 -0
- package/js/src/m/GraphModel.js +1 -1
- package/package.json +1 -1
package/js/src/GraphEditor.js
CHANGED
|
@@ -21,6 +21,8 @@ class DualboxEditor {
|
|
|
21
21
|
this.div = $(div);
|
|
22
22
|
this.attrs = attrs;
|
|
23
23
|
|
|
24
|
+
this.rootAppName = attrs.name ? attrs.name : "Application";
|
|
25
|
+
|
|
24
26
|
// MVC model
|
|
25
27
|
this.m = new GraphModel(this);
|
|
26
28
|
this.v = new GraphView(this, div, attrs);
|
|
@@ -100,6 +102,10 @@ class DualboxEditor {
|
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
this.loadCorePackages();
|
|
105
|
+
|
|
106
|
+
if( attrs.json ) {
|
|
107
|
+
this.setApp(json);
|
|
108
|
+
}
|
|
103
109
|
}
|
|
104
110
|
|
|
105
111
|
loadCorePackages() {
|
package/js/src/m/GraphModel.js
CHANGED
|
@@ -37,7 +37,7 @@ class GraphModel {
|
|
|
37
37
|
windows : null
|
|
38
38
|
};
|
|
39
39
|
this.data.app = this.data.root;
|
|
40
|
-
this.data.windows = [[
|
|
40
|
+
this.data.windows = [[ this.e.rootAppName, this.data.app ]];
|
|
41
41
|
|
|
42
42
|
// An object to save/restore different states of this.data (ctrl-z/ctrl-y)
|
|
43
43
|
this.history = new History(this);
|