File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
source/client/js/classEditor Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 22 "name" : " cache-visual-editor" ,
33 "printableName" : " Cache Visual Editor" ,
44 "packageName" : " VisualEditor" ,
5- "version" : " 0.8.6 " ,
5+ "version" : " 0.8.7 " ,
66 "description" : " Visual class editor for InterSystems Caché" ,
77 "main" : " index.js" ,
88 "keywords" : [
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export function getClassElement (data) {
1919 } `) ,
2020 header = block ( `div` , `header` ) ;
2121
22+ data [ `__visualClassElement` ] = card ;
23+
2224 if ( type === "class" ) // float priority
2325 head . appendChild ( controls ) ;
2426 head . appendChild ( headIcon ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { getKeywordView } from "./keyword";
66import MANIFEST from "./MANIFEST" ;
77import { MEMBER_SECTIONS , getMemberSection } from "./memberSection" ;
88import { getCodeCaptionView } from "./code" ;
9+ import { updateGridElement } from "./../index" ;
910
1011/**
1112 * Creates and returns interactive class block property editor.
@@ -85,6 +86,9 @@ function enableMember ({
8586 ? [ classData [ "Name" ] ]
8687 : [ classData [ "Name" ] , classBlockName , classBlockPropName ] ;
8788
89+ if ( typeof classData [ `__visualCodeBlocksOpened` ] === "undefined" )
90+ classData [ `__visualCodeBlocksOpened` ] = 0 ;
91+
8892 headerElement . addEventListener ( `click` , ( ) => {
8993 if ( ! container ) {
9094
@@ -187,6 +191,13 @@ function enableMember ({
187191 }
188192 headerElement . classList . toggle ( "opened" ) ;
189193
194+ if ( classBlockName === "Methods" ) {
195+ classData [ `__visualCodeBlocksOpened` ] += opened ? 1 : - 1 ;
196+ updateGridElement ( classData [ `__visualClassElement` ] , {
197+ width : classData [ `__visualCodeBlocksOpened` ] > 0 ? 2 : 1
198+ } ) ;
199+ }
200+
190201 updateGrid ( ) ;
191202 } ) ;
192203
Original file line number Diff line number Diff line change @@ -22,10 +22,14 @@ let grid = onInit(() => grid = new AutoGrid(document.querySelector("#classBuilde
2222 * Function which updates current grid.
2323 */
2424export function updateGrid ( ) {
25- window . autoGrid = grid ;
2625 grid . updateGrid ( ) ;
2726}
2827
28+ export function updateGridElement ( element , data = { } ) {
29+ if ( element instanceof HTMLElement )
30+ grid . updateChild ( element , data ) ;
31+ }
32+
2933/**
3034 * Behaviors for elements on page.
3135 * @type {HTMLElement }
You can’t perform that action at this time.
0 commit comments