Hints
diff --git a/src/main/webapp/css/layers.css b/src/main/webapp/css/layers.css
index dfcb405da..99d09863f 100644
--- a/src/main/webapp/css/layers.css
+++ b/src/main/webapp/css/layers.css
@@ -1,2 +1,2 @@
-#lessonTitle {position:absolute;left:94px;top:75px;width:690px;height:22px;z-index:1;float: right;font-size: 20px;color: #FFFFFF;}
+#lesson-title {position:absolute;left:94px;top:75px;width:690px;height:22px;z-index:1;float: right;font-size: 20px;color: #FFFFFF;}
#hMenuBar {position:absolute;left:245px;top:108px;width:538px;height:22px;z-index:2;}
diff --git a/src/main/webapp/css/main.css b/src/main/webapp/css/main.css
index 9c45a472e..7297fdf99 100644
--- a/src/main/webapp/css/main.css
+++ b/src/main/webapp/css/main.css
@@ -132,7 +132,7 @@ img {
#header .user-nav button:hover i {
color: #F6F6F6;
}
-#header .lessonTitle {
+#header #lesson-title-wrapper {
display: inline-block;
margin:0 0 0 20px;
}
@@ -849,8 +849,16 @@ cookieContainer {
cursor: pointer;
}
-
.info {
color:#e84c3d;
font-weight: bold;
+}
+
+#help-controls {
+ padding-left: 4px;
+ padding-top: 4px
+}
+
+.help-button {
+ margin-right:4px;
}
\ No newline at end of file
diff --git a/src/main/webapp/js/goatApp/controller/LessonController.js b/src/main/webapp/js/goatApp/controller/LessonController.js
index 4f95485b0..83cd15e6f 100644
--- a/src/main/webapp/js/goatApp/controller/LessonController.js
+++ b/src/main/webapp/js/goatApp/controller/LessonController.js
@@ -6,7 +6,8 @@ define(['jquery',
'goatApp/view/PlanView',
'goatApp/view/SourceView',
'goatApp/view/SolutionView',
- 'goatApp/view/LessonHintView'
+ 'goatApp/view/LessonHintView',
+ 'goatApp/view/HelpControlsView'
],
function($,
_,
@@ -16,7 +17,8 @@ define(['jquery',
PlanView,
SourceView,
SolutionView,
- LessonHintView
+ LessonHintView,
+ HelpControlsView
) {
'use strict'
@@ -33,7 +35,7 @@ define(['jquery',
_.extend(Controller.prototype,Backbone.Events);
this.start = function() {
this.listenTo(this.lessonContent,'contentLoaded',this.onContentLoaded);
- }
+ };
//load View, which can pull data
this.loadLesson = function(scr,menu) {
@@ -60,19 +62,37 @@ define(['jquery',
//load title view (initially hidden) << currently handled via menu click but need to be able to handle via routed request
//plan view (initially hidden)
this.planView = new PlanView();
+ this.listenTo(this.planView,'plan:loaded',this.areHelpsReady);
//solution view (initially hidden)
this.solutionView = new SolutionView();
+ this.listenTo(this.solutionView,'solution:loaded',this.areHelpsReady);
//source (initially hidden)
this.sourceView = new SourceView();
+ this.listenTo(this.sourceView,'source:loaded',this.areHelpsReady);
//load help controls view (contextul to what helps are available)
this.lessonHintView = new LessonHintView();
this.listenTo(this.lessonHintView,'hints:loaded',this.areHelpsReady);
- },
+
+ };
+
this.areHelpsReady = function (curHelp) {
- this.helpsLoaded[curHelp.helpElement] = curHelp.value;
+ this.addCurHelpState(curHelp);
// check if all are ready
- }
-
+ if (this.helpsLoaded['hints'] && this.helpsLoaded['plan'] && this.helpsLoaded['solution'] && this.helpsLoaded['source']) {
+ //
+ this.helpControlsView = new HelpControlsView({
+ hasPlan:(this.planView.model.get('content') !== null),
+ hasSolution:(this.solutionView.model.get('content') !== null),
+ hasSource:(this.sourceView.model.get('content') !== null),
+ hasHints:(this.lessonHintView.collection.length > 0),
+ });
+ this.helpControlsView.render();
+ }
+ };
+
+ this.addCurHelpState = function (curHelp) {
+ this.helpsLoaded[curHelp.helpElement] = curHelp.value;
+ };
};
return Controller;
});
\ No newline at end of file
diff --git a/src/main/webapp/js/goatApp/model/MenuCollection.js b/src/main/webapp/js/goatApp/model/MenuCollection.js
index 2c10179af..6df19033f 100644
--- a/src/main/webapp/js/goatApp/model/MenuCollection.js
+++ b/src/main/webapp/js/goatApp/model/MenuCollection.js
@@ -18,4 +18,4 @@ define(['jquery',
this.trigger('menuData:loaded');
}
});
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/src/main/webapp/js/goatApp/model/MenuModel.js b/src/main/webapp/js/goatApp/model/MenuModel.js
index f141d1108..a416ad7b1 100644
--- a/src/main/webapp/js/goatApp/model/MenuModel.js
+++ b/src/main/webapp/js/goatApp/model/MenuModel.js
@@ -7,19 +7,4 @@ define(['jquery',
});
-});
-
- // accordionMenu = function(id) {
- // if ($('ul#' + id).attr('isOpen') == 0) {
- // $scope.expandMe = true;
- // } else {
- // $('ul#' + id).slideUp(300).attr('isOpen', 0);u
- // return;
- // }
- // $scope.openMenu = id;
- // $('.lessonsAndStages').not('ul#' + id).slideUp(300).attr('isOpen', 0);
- // if ($scope.expandMe) {
- // $('ul#' + id).slideDown(300).attr('isOpen', 1);
- // }
- // }
-
+});
\ No newline at end of file
diff --git a/src/main/webapp/js/goatApp/view/HelpControlsView.js b/src/main/webapp/js/goatApp/view/HelpControlsView.js
index fc09e66a2..424896bc2 100644
--- a/src/main/webapp/js/goatApp/view/HelpControlsView.js
+++ b/src/main/webapp/js/goatApp/view/HelpControlsView.js
@@ -4,6 +4,14 @@ define(['jquery',
function($,_,Backbone) {
return Backbone.View.extend({
el:'#help-controls', //Check this
+ helpButtons: {
+ //TODO: move this into a template
+ showSource:$('