@@ -19,6 +19,7 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
1919 zoomInButton : id ( "button.zoomIn" ) ,
2020 zoomOutButton : id ( "button.zoomOut" ) ,
2121 zoomNormalButton : id ( "button.zoomNormal" ) ,
22+ showSettingsButton : id ( "button.showSettings" ) ,
2223 helpButton : id ( "button.showHelp" ) ,
2324 infoButton : id ( "button.showInfo" ) ,
2425 methodCodeView : id ( "methodCodeView" ) ,
@@ -33,7 +34,18 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
3334 classTreeSearch : id ( "classTreeSearch" ) ,
3435 searchBlock : id ( "searchBlock" ) ,
3536 diagramSearch : id ( "diagramSearch" ) ,
36- diagramSearchButton : id ( "button.diagramSearch" )
37+ diagramSearchButton : id ( "button.diagramSearch" ) ,
38+ settingsView : id ( "settingsView" ) ,
39+ closeSettings : id ( "closeSettings" ) ,
40+ settings : {
41+ showDataTypesOnDiagram : id ( "setting.showDataTypesOnDiagram" )
42+ }
43+ } ;
44+
45+ this . settings = {
46+ showDataTypesOnDiagram :
47+ localStorage . getItem ( "showDataTypesOnDiagram" ) === null ? false :
48+ localStorage . getItem ( "showDataTypesOnDiagram" ) === "true"
3749 } ;
3850
3951 this . UI = new UI ( this ) ;
@@ -42,10 +54,25 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
4254 this . classView = new ClassView ( this , classViewContainer ) ;
4355 this . NAMESPACE = null ;
4456
57+ this . initSettings ( ) ;
4558 this . init ( ) ;
4659
4760} ;
4861
62+ CacheUMLExplorer . prototype . initSettings = function ( ) {
63+
64+ var self = this ;
65+
66+ this . elements . settings . showDataTypesOnDiagram . checked = this . settings . showDataTypesOnDiagram ;
67+ this . elements . settings . showDataTypesOnDiagram . addEventListener ( "change" , function ( e ) {
68+ localStorage . setItem (
69+ "showDataTypesOnDiagram" ,
70+ self . settings . showDataTypesOnDiagram = ( e . target || e . srcElement ) . checked
71+ ) ;
72+ } ) ;
73+
74+ } ;
75+
4976/**
5077 * Render namespaces.
5178 * @param nsData
@@ -153,6 +180,12 @@ CacheUMLExplorer.prototype.init = function () {
153180 self . setNamespace ( ns ) ;
154181 }
155182 } ) ;
183+ this . elements . showSettingsButton . addEventListener ( "click" , function ( ) {
184+ self . elements . settingsView . classList . add ( "active" ) ;
185+ } ) ;
186+ this . elements . closeSettings . addEventListener ( "click" , function ( ) {
187+ self . elements . settingsView . classList . remove ( "active" ) ;
188+ } ) ;
156189
157190 enableSVGDownload ( this . classTree ) ;
158191
0 commit comments