fixing my mess from earlier. hints, plans, solutions etc. working again. params still quirky

This commit is contained in:
Jason White 2014-09-15 22:16:26 -06:00
parent 149e7ecc40
commit 80b776f7fd
3 changed files with 49 additions and 50 deletions

View File

@ -62,7 +62,7 @@
</head>
<body class="animated fadeIn" ng-app="goatApp">
<section id="container">
<section id="container" ng-controller="goatLesson">
<header id="header">
<!--logo start-->
<div class="brand">
@ -128,7 +128,7 @@
<!--sidebar left end-->
<!--main content start-->
<section class="main-content-wrapper">
<section id="main-content" ng-controller="goatLesson">
<section id="main-content" > <!--ng-controller="goatLesson"-->
<div class="row">
<div class="col-md-8">
<div class="col-md-12" align="left">

View File

@ -3,12 +3,7 @@
/* ### GOAT CONTROLLERS ### */
/** Lesson Controller (includes menu stuff)
* prepares and updates menu topic items for the view
*/
//<<<<<<< Updated upstream
//goat.controller('goatLesson', function($scope, $http, $modal, $log, $sce) { //$templateCache
//=======
/* menu controller */
var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
$scope.cookies = [];
$scope.params = [];
@ -36,7 +31,7 @@ var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
// use jquery to render lesson content to div
$scope.hintIndex = 0;
var curScope = $scope;
$('.lessonHelp').hide();
curScope.parameters = goat.utils.scrapeParams(url);
goat.data.loadLessonContent($http,url).then(
function(reply) {
@ -47,6 +42,7 @@ var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
);
$("#lesson_content").html(reply.data);
$('#leftside-navigation').height($('#main-content').height()+15)
$scope.$emit('lessonUpdate',{params:curScope.parameters});
}
)};
$scope.accordionMenu = function(id) {
@ -86,23 +82,23 @@ var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
});*/
/* lesson controller */
var goatLesson = function($scope,$http,$log) {
//hook forms
$('#hintsView').hide();
// adjust menu to lessonContent size if necssary
//@TODO: this is still clunky ... needs some TLC
if ($('div.panel-body').height() > 400) {
$('#leftside-navigation').height($(window).height());
}
//cookies
$scope.$on('lessonUpdate',function(params){
$scope.parameters = arguments[1];
curScope = $scope; //TODO .. update below, this curScope is probably not needed
goat.data.loadCookies($http).then(
function(resp) {
curScope.cookies = resp.data;
}
);
//hints
curScope = $scope; //TODO .. update below, this curScope is probably not needed
curScope.hintIndex = 0;
goat.data.loadHints($http).then(
function(resp) {
@ -132,7 +128,9 @@ var goatLesson = function($scope,$http,$log) {
curScope.solution = resp.data;
}
);
goat.utils.scrollToTop();
});
//goat.utils.scrollToTop();
$scope.showLessonSource = function() {

View File

@ -53,6 +53,7 @@ goat.utils = {
goat.utils.scrollToHelp();
},
scrollToHelp:function() {
$('#leftside-navigation').height($('#main-content').height()+15)
var target = $('#lessonHelpsWrapper');
goat.utils.scrollEasy(target);
},