File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed
Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 2929Development
3030-----------
3131
32- Requires [ Node.JS] ( https://nodejs.org ) (v0.10 .0-6.2.2+ ),
32+ Requires [ Node.JS] ( https://nodejs.org ) (v4.0 .0-7.5.0+) (but may work on previous versions ),
3333[ Git] ( https://git-scm.com ) and
3434[ Caché] ( http://www.intersystems.com/library/software-downloads/ ) 2017.1+
3535to be installed.
Original file line number Diff line number Diff line change 11{
22 "name" : " iknow-entity-browser" ,
3- "version" : " 0.6.2 " ,
3+ "version" : " 0.6.3 " ,
44 "description" : " Visualizer for iKnow entities" ,
55 "main" : " gulpfile.babel.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 11import * as model from "../model" ;
22import * as graph from "../graph" ;
3+ import { getChanges , applyChanges } from "../source" ;
34
45function toggleSettings ( uiStateModel ) {
56 uiStateModel . settingsToggled = ! uiStateModel . settingsToggled ;
67 d3 . select ( "#settings" ) . classed ( "active" , uiStateModel . settingsToggled ) ;
78 d3 . select ( "#windows" ) . classed ( "offScreen" , uiStateModel . settingsToggled ) ;
8- if ( ! uiStateModel . settingsToggled ) {
9+ if ( ! uiStateModel . settingsToggled && getChanges ( ) . length !== 0 ) {
10+ applyChanges ( ) ;
911 model . update ( ( ) => graph . update ( true ) ) ;
1012 }
1113}
Original file line number Diff line number Diff line change @@ -11,12 +11,27 @@ let settings = { // assign defaults here
1111 queryType : "related" ,
1212 seed : "crew"
1313} ;
14+ let changes = [ ] ;
1415
1516let initialStorage = storage . load ( STORAGE_KEY ) ;
1617for ( let option in initialStorage ) {
1718 settings [ option ] = initialStorage [ option ] ;
1819}
1920
21+ /**
22+ * This function "applies" settings so that getChanges() will return empty array until
23+ */
24+ export function applyChanges ( ) {
25+ changes = [ ] ;
26+ }
27+
28+ /**
29+ * @returns {string[] } of changed keys.
30+ */
31+ export function getChanges ( ) {
32+ return changes ;
33+ }
34+
2035export function getOption ( opt ) {
2136 return settings [ opt ] ;
2237}
@@ -63,7 +78,7 @@ function setValue (e = {}) {
6378 if ( ( id = el . getAttribute ( `id` ) ) . indexOf ( `settings.` ) === 0 ) {
6479 let key = id . replace ( / ^ s e t t i n g s \. / , `` ) ;
6580 if ( isEvent ) {
66- settings [ key ] = el . value ;
81+ changes . push ( settings [ key ] = el . value ) ;
6782 saveSettings ( ) ;
6883 } else {
6984 el . value = settings [ key ] ;
You can’t perform that action at this time.
0 commit comments