File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change 33const modules = require ( '../module' ) ;
44const array2d = require ( './array2d' ) ;
55const util = require ( './util' ) ;
6+ const Server = require ( '../server' ) ;
7+ const DOM = require ( '../dom' ) ;
68
7- const closeCreate = ( modules ) => {
9+ const {
10+ getPath
11+ } = require ( '../server/helpers' ) ;
12+
13+ const closeCreate = ( ) => {
814 const $btnClose = $ ( '#btn_close' ) ;
915
1016 $btnClose . click ( ( ) => {
1117 $ ( '.sandbox_container' ) . remove ( ) ;
1218 util . clearModules ( ) ;
13- restoreModules ( modules ) ;
19+ reloadAlgorithm ( ) ;
1420 } ) ;
1521} ;
1622
17- const restoreModules = ( modules ) => {
18- for ( var i = 0 ; i < modules . length ; i ++ ) {
19- $ ( '.module_container' ) . append ( modules [ i ] ) ;
20- }
21- } ;
23+ const reloadAlgorithm = ( ) => {
24+ const {
25+ category,
26+ algorithm,
27+ file
28+ } = getPath ( ) ;
2229
23- const saveModules = ( ) => {
24- return $ ( '.module_wrapper' )
30+ Server . loadAlgorithm ( category , algorithm ) . then ( ( data ) => {
31+ DOM . showAlgorithm ( category , algorithm , data ) ;
32+ } ) ;
2533} ;
2634
35+
36+
2737const init = ( ) => {
28- var moduleWrappers = saveModules ( ) ;
38+
2939 var check = $ ( '.sandbox_container' ) ;
3040 if ( ! check . length ) {
3141 util . clearModules ( ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ RSVP.on('error', function (reason) {
3232} ) ;
3333
3434$ ( ( ) => {
35-
3635 // initialize the application and attach in to the instance module
3736 const appConstructor = new AppConstructor ( ) ;
3837 extend ( true , app , appConstructor ) ;
You can’t perform that action at this time.
0 commit comments