File tree 4 files changed +19
-2
lines changed
source/client/js/classEditor
4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " cache-visual-editor" ,
3
3
"printableName" : " Cache Visual Editor" ,
4
4
"packageName" : " VisualEditor" ,
5
- "version" : " 0.8.6 " ,
5
+ "version" : " 0.8.7 " ,
6
6
"description" : " Visual class editor for InterSystems Caché" ,
7
7
"main" : " index.js" ,
8
8
"keywords" : [
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export function getClassElement (data) {
19
19
} `) ,
20
20
header = block ( `div` , `header` ) ;
21
21
22
+ data [ `__visualClassElement` ] = card ;
23
+
22
24
if ( type === "class" ) // float priority
23
25
head . appendChild ( controls ) ;
24
26
head . appendChild ( headIcon ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { getKeywordView } from "./keyword";
6
6
import MANIFEST from "./MANIFEST" ;
7
7
import { MEMBER_SECTIONS , getMemberSection } from "./memberSection" ;
8
8
import { getCodeCaptionView } from "./code" ;
9
+ import { updateGridElement } from "./../index" ;
9
10
10
11
/**
11
12
* Creates and returns interactive class block property editor.
@@ -85,6 +86,9 @@ function enableMember ({
85
86
? [ classData [ "Name" ] ]
86
87
: [ classData [ "Name" ] , classBlockName , classBlockPropName ] ;
87
88
89
+ if ( typeof classData [ `__visualCodeBlocksOpened` ] === "undefined" )
90
+ classData [ `__visualCodeBlocksOpened` ] = 0 ;
91
+
88
92
headerElement . addEventListener ( `click` , ( ) => {
89
93
if ( ! container ) {
90
94
@@ -187,6 +191,13 @@ function enableMember ({
187
191
}
188
192
headerElement . classList . toggle ( "opened" ) ;
189
193
194
+ if ( classBlockName === "Methods" ) {
195
+ classData [ `__visualCodeBlocksOpened` ] += opened ? 1 : - 1 ;
196
+ updateGridElement ( classData [ `__visualClassElement` ] , {
197
+ width : classData [ `__visualCodeBlocksOpened` ] > 0 ? 2 : 1
198
+ } ) ;
199
+ }
200
+
190
201
updateGrid ( ) ;
191
202
} ) ;
192
203
Original file line number Diff line number Diff line change @@ -22,10 +22,14 @@ let grid = onInit(() => grid = new AutoGrid(document.querySelector("#classBuilde
22
22
* Function which updates current grid.
23
23
*/
24
24
export function updateGrid ( ) {
25
- window . autoGrid = grid ;
26
25
grid . updateGrid ( ) ;
27
26
}
28
27
28
+ export function updateGridElement ( element , data = { } ) {
29
+ if ( element instanceof HTMLElement )
30
+ grid . updateChild ( element , data ) ;
31
+ }
32
+
29
33
/**
30
34
* Behaviors for elements on page.
31
35
* @type {HTMLElement }
You can’t perform that action at this time.
0 commit comments