@@ -22,6 +22,14 @@ const datasetsClose = document.getElementById('datasetsClose');
2222datasetsBtn . onclick = function ( ) { datasetsModal . style . display = "block" ; }
2323datasetsClose . onclick = function ( ) { datasetsModal . style . display = "none" ; }
2424
25+ /* Dashboards */
26+ const dashboardModal = document . getElementById ( 'dashboardModal' ) ;
27+ const dashboardBtn = document . getElementById ( 'dashboardBtn' ) ;
28+ const dashboardClose = document . getElementById ( 'dashboardClose' ) ;
29+
30+ dashboardBtn . onclick = function ( ) { dashboardModal . style . display = "block" ; }
31+ dashboardClose . onclick = function ( ) { dashboardModal . style . display = "none" ; }
32+
2533/* ML Algorithms */
2634const mlAlgorithmsModal = document . getElementById ( 'mlAlgorithmsModal' ) ;
2735const mlAlgorithmsBtn = document . getElementById ( 'mlAlgorithmsBtn' ) ;
@@ -30,21 +38,30 @@ const mlAlgorithmsClose = document.getElementById('mlAlgorithmsClose');
3038mlAlgorithmsBtn . onclick = function ( ) { mlAlgorithmsModal . style . display = "block" ; }
3139mlAlgorithmsClose . onclick = function ( ) { mlAlgorithmsModal . style . display = "none" ; }
3240
33- /* Dashboards */
34- const dashboardModal = document . getElementById ( 'dashboardModal ' ) ;
35- const dashboardBtn = document . getElementById ( 'dashboardBtn ' ) ;
36- const dashboardClose = document . getElementById ( 'dashboardClose ' ) ;
41+ /* Recommendation System */
42+ const recommendationSystemModal = document . getElementById ( 'recommendationSystemModal ' ) ;
43+ const recommendationSystemBtn = document . getElementById ( 'recommendationSystemBtn ' ) ;
44+ const recommendationSystemClose = document . getElementById ( 'recommendationSystemClose ' ) ;
3745
38- dashboardBtn . onclick = function ( ) { dashboardModal . style . display = "block" ; }
39- dashboardClose . onclick = function ( ) { dashboardModal . style . display = "none" ; }
46+ recommendationSystemBtn . onclick = function ( ) { recommendationSystemModal . style . display = 'block' ; }
47+ recommendationSystemClose . onclick = function ( ) { recommendationSystemModal . style . display = 'none' ; }
48+
49+ /* Statistic and Probability */
50+ const statisticProbabilityModal = document . getElementById ( 'statisticProbabilityModal' ) ;
51+ const statisticProbabilityBtn = document . getElementById ( 'statisticProbabilityBtn' ) ;
52+ const statisticProbabilityClose = document . getElementById ( 'statisticProbabilityClose' ) ;
53+
54+ statisticProbabilityBtn . onclick = function ( ) { statisticProbabilityModal . style . display = 'block' ; }
55+ statisticProbabilityClose . onclick = function ( ) { statisticProbabilityModal . style . display = 'none' ; }
4056
4157/* Closing modals when user taps outside the modal */
4258window . onclick = function ( event ) {
43- if ( event . target == kaggleModal ) { kaggleModal . style . display = "none" ; }
44- else if ( event . target == liveProjectsModal ) { liveProjectsModal . style . display = "none" ; }
45- else if ( event . target == datasetsModal ) { datasetsModal . style . display = "none" ; }
46- else if ( event . target == mlAlgorithmsModal ) { mlAlgorithmsModal . style . display = "none" ; }
47- else if ( event . target == dashboardModal ) { dashboardModal . style . display = "none" ; }
59+ const modalsArray = [
60+ kaggleModal , liveProjectsModal , datasetsModal , dashboardModal
61+ , mlAlgorithmsModal , recommendationSystemModal , statisticProbabilityModal
62+ ]
63+
64+ if ( modalsArray . includes ( event . target ) ) { event . target . style . display = 'none' ; }
4865}
4966
5067/* Closing modals when user presses Escape (Esc) */
@@ -53,7 +70,9 @@ window.onkeydown = function(event) {
5370 if ( kaggleModal . style . display == 'block' ) { kaggleModal . style . display = 'none' ; }
5471 else if ( liveProjectsModal . style . display == 'block' ) { liveProjectsModal . style . display = 'none' ; }
5572 else if ( datasetsModal . style . display == 'block' ) { datasetsModal . style . display = 'none' ; }
56- else if ( mlAlgorithmsModal . style . display == 'block' ) { mlAlgorithmsModal . style . display = 'none' ; }
5773 else if ( dashboardModal . style . display == 'block' ) { dashboardModal . style . display = 'none' ; }
74+ else if ( mlAlgorithmsModal . style . display == 'block' ) { mlAlgorithmsModal . style . display = 'none' ; }
75+ else if ( recommendationSystemModal . style . display == 'block' ) { recommendationSystemModal . style . display = 'none' ; }
76+ else if ( statisticProbabilityModal . style . display == 'block' ) { statisticProbabilityModal . style . display = 'none' ; }
5877 }
5978}
0 commit comments