From 5c87d98c0b3383c7ad63f0b69e36110b915e36c2 Mon Sep 17 00:00:00 2001 From: Robert Zorko Date: Tue, 22 Sep 2015 18:13:31 +0200 Subject: enabled buttons in the navigation header (at least buttons on the left side of the bar), renamed stateMachine to navigation --- js/codeq/problem.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'js/codeq/problem.js') diff --git a/js/codeq/problem.js b/js/codeq/problem.js index 6debf6d..f19cbd4 100644 --- a/js/codeq/problem.js +++ b/js/codeq/problem.js @@ -7,10 +7,26 @@ */ (function(){ + var lastLanguage; codeq.globalStateMachine.register('problem',{ 'enter': function(language){ + if(language)lastLanguage = language; + else language = lastLanguage;//This happens when we hit this with the back button + $('#disabled').css('display', ''); $('#disabled').css('cursor', 'wait'); + + $('#navigation-login').css('display', ''); + /*$('#navigation-login').on('click', function(){ + codeq.globalStateMachine.transition('login'); + });*/ + $('#navigation-language').css('display', ''); + /*$('#navigation-language').on('click', function(){ + codeq.globalStateMachine.transition('language'); + });*/ + $("#navigation-problem").addClass("active"); + $('#navigation-problem').css('display', ''); + codeq.comms.send({'action': 'list_problems', 'language':language}) .then( function success(data) { @@ -99,6 +115,13 @@ $("#problem_group option").remove();//empty the selects $("#problems option").remove(); $("#screen_problem").css('display', 'none'); + + $('#navigation-login').css('display', 'none'); + //$('#navigation-login').off(); + $('#navigation-language').css('display', 'none'); + //$('#navigation-language').off(); + $('#navigation-problem').css('display', 'none'); + $("#navigation-problem").removeClass("active"); } }); })(); \ No newline at end of file -- cgit v1.2.1