This commit is contained in:
parent
cc9ae0a6a9
commit
65621e51cf
@ -85,7 +85,7 @@ define(['jquery',
|
||||
paramModel.set('stageParam',this.lessonContent.get('stageParam'));
|
||||
this.paramView = new ParamView({model:paramModel});
|
||||
|
||||
this.hideShowHelps(null);
|
||||
$('.lesson-help').hide();
|
||||
this.trigger('menu:reload');
|
||||
};
|
||||
|
||||
@ -122,19 +122,26 @@ define(['jquery',
|
||||
if (!showId) {
|
||||
return;
|
||||
}
|
||||
switch(showHelp) {
|
||||
case 'plan':
|
||||
$(contentId).html(this.planView.model.get('content'));
|
||||
break;
|
||||
case 'solution':
|
||||
$(showId).html(this.solutionView.model.get('content'));
|
||||
break;
|
||||
case 'source':
|
||||
$(contentId).html('<pre>' + this.sourceView.model.get('content') + '</pre>');
|
||||
break;
|
||||
|
||||
if ($(showId).is(':visible')) {
|
||||
$(showId).hide();
|
||||
return;
|
||||
} else {
|
||||
//TODO: move individual .html operations into individual help views
|
||||
switch(showHelp) {
|
||||
case 'plan':
|
||||
$(contentId).html(this.planView.model.get('content'));
|
||||
break;
|
||||
case 'solution':
|
||||
$(showId).html(this.solutionView.model.get('content'));
|
||||
break;
|
||||
case 'source':
|
||||
$(contentId).html('<pre>' + this.sourceView.model.get('content') + '</pre>');
|
||||
break;
|
||||
}
|
||||
$(showId).show();
|
||||
GoatUtils.scrollToHelp()
|
||||
}
|
||||
$(showId).show();
|
||||
GoatUtils.scrollToHelp()
|
||||
};
|
||||
|
||||
this.onShowHints = function() {
|
||||
|
@ -6,9 +6,9 @@ function($,_,Backbone) {
|
||||
el:'#help-controls', //Check this
|
||||
helpButtons: {
|
||||
//TODO: move this into a template
|
||||
showSource:$('<button>',{id:'show-source-button','class':'btn btn-primary btn-xs help-button',type:'button',text:'Java [Source]'}),
|
||||
showSource:$('<button>',{id:'show-source-button','class':'btn btn-primary btn-xs help-button',type:'button',text:'Java Source'}),
|
||||
showSolution:$('<button>',{id:'show-solution-button','class':'btn btn-primary btn-xs help-button',type:'button',text:'Solution'}),
|
||||
showPlan:$('<button>',{id:'show-plan-button','class':'btn btn-primary btn-xs help-button',type:'button',text:'Lesson Plan]'}),
|
||||
showPlan:$('<button>',{id:'show-plan-button','class':'btn btn-primary btn-xs help-button',type:'button',text:'Lesson Plan'}),
|
||||
showHints:$('<button>',{id:'show-hints-button','class':'btn btn-primary btn-xs help-button',type:'button',text:'Hints'}),
|
||||
restartLesson:$('<button>',{id:'restart-lesson-button','class':'btn btn-xs help-button',type:'button',text:'Restart Lesson'})
|
||||
},
|
||||
|
@ -17,6 +17,7 @@ define(['jquery',
|
||||
this.$el.html(this.model.get('content'));
|
||||
this.makeFormsAjax();
|
||||
this.ajaxifyAttackHref();
|
||||
$(window).scrollTop(0); //work-around til we get the scroll down sorted out
|
||||
},
|
||||
//TODO: reimplement this in custom fashion maybe?
|
||||
makeFormsAjax: function () {
|
||||
|
@ -13,9 +13,11 @@ function($,
|
||||
this.listenTo(this.model,'loaded',this.onModelLoaded);
|
||||
this.model.loadData();
|
||||
},
|
||||
|
||||
render:function(title) {
|
||||
|
||||
},
|
||||
|
||||
onModelLoaded: function() {
|
||||
this.trigger('plan:loaded',{'helpElement':'plan','value':true});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user