fixing my mess from earlier. hints, plans, solutions etc. working again. params still quirky
This commit is contained in:
parent
149e7ecc40
commit
80b776f7fd
@ -62,7 +62,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="animated fadeIn" ng-app="goatApp">
|
<body class="animated fadeIn" ng-app="goatApp">
|
||||||
<section id="container">
|
<section id="container" ng-controller="goatLesson">
|
||||||
<header id="header">
|
<header id="header">
|
||||||
<!--logo start-->
|
<!--logo start-->
|
||||||
<div class="brand">
|
<div class="brand">
|
||||||
@ -128,7 +128,7 @@
|
|||||||
<!--sidebar left end-->
|
<!--sidebar left end-->
|
||||||
<!--main content start-->
|
<!--main content start-->
|
||||||
<section class="main-content-wrapper">
|
<section class="main-content-wrapper">
|
||||||
<section id="main-content" ng-controller="goatLesson">
|
<section id="main-content" > <!--ng-controller="goatLesson"-->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="col-md-12" align="left">
|
<div class="col-md-12" align="left">
|
||||||
|
@ -3,12 +3,7 @@
|
|||||||
|
|
||||||
/* ### GOAT CONTROLLERS ### */
|
/* ### GOAT CONTROLLERS ### */
|
||||||
|
|
||||||
/** Lesson Controller (includes menu stuff)
|
/* menu controller */
|
||||||
* prepares and updates menu topic items for the view
|
|
||||||
*/
|
|
||||||
//<<<<<<< Updated upstream
|
|
||||||
//goat.controller('goatLesson', function($scope, $http, $modal, $log, $sce) { //$templateCache
|
|
||||||
//=======
|
|
||||||
var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
|
var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
|
||||||
$scope.cookies = [];
|
$scope.cookies = [];
|
||||||
$scope.params = [];
|
$scope.params = [];
|
||||||
@ -36,7 +31,7 @@ var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
|
|||||||
// use jquery to render lesson content to div
|
// use jquery to render lesson content to div
|
||||||
$scope.hintIndex = 0;
|
$scope.hintIndex = 0;
|
||||||
var curScope = $scope;
|
var curScope = $scope;
|
||||||
|
$('.lessonHelp').hide();
|
||||||
curScope.parameters = goat.utils.scrapeParams(url);
|
curScope.parameters = goat.utils.scrapeParams(url);
|
||||||
goat.data.loadLessonContent($http,url).then(
|
goat.data.loadLessonContent($http,url).then(
|
||||||
function(reply) {
|
function(reply) {
|
||||||
@ -47,6 +42,7 @@ var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
|
|||||||
);
|
);
|
||||||
$("#lesson_content").html(reply.data);
|
$("#lesson_content").html(reply.data);
|
||||||
$('#leftside-navigation').height($('#main-content').height()+15)
|
$('#leftside-navigation').height($('#main-content').height()+15)
|
||||||
|
$scope.$emit('lessonUpdate',{params:curScope.parameters});
|
||||||
}
|
}
|
||||||
)};
|
)};
|
||||||
$scope.accordionMenu = function(id) {
|
$scope.accordionMenu = function(id) {
|
||||||
@ -86,23 +82,23 @@ var goatMenu = function($scope, $http, $modal, $log, $templateCache) {
|
|||||||
|
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
|
/* lesson controller */
|
||||||
var goatLesson = function($scope,$http,$log) {
|
var goatLesson = function($scope,$http,$log) {
|
||||||
//hook forms
|
//hook forms
|
||||||
|
|
||||||
$('#hintsView').hide();
|
$('#hintsView').hide();
|
||||||
// adjust menu to lessonContent size if necssary
|
// 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
|
//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(
|
goat.data.loadCookies($http).then(
|
||||||
function(resp) {
|
function(resp) {
|
||||||
curScope.cookies = resp.data;
|
curScope.cookies = resp.data;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//hints
|
//hints
|
||||||
curScope = $scope; //TODO .. update below, this curScope is probably not needed
|
|
||||||
curScope.hintIndex = 0;
|
curScope.hintIndex = 0;
|
||||||
goat.data.loadHints($http).then(
|
goat.data.loadHints($http).then(
|
||||||
function(resp) {
|
function(resp) {
|
||||||
@ -132,7 +128,9 @@ var goatLesson = function($scope,$http,$log) {
|
|||||||
curScope.solution = resp.data;
|
curScope.solution = resp.data;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
goat.utils.scrollToTop();
|
});
|
||||||
|
|
||||||
|
//goat.utils.scrollToTop();
|
||||||
|
|
||||||
|
|
||||||
$scope.showLessonSource = function() {
|
$scope.showLessonSource = function() {
|
||||||
|
@ -53,6 +53,7 @@ goat.utils = {
|
|||||||
goat.utils.scrollToHelp();
|
goat.utils.scrollToHelp();
|
||||||
},
|
},
|
||||||
scrollToHelp:function() {
|
scrollToHelp:function() {
|
||||||
|
$('#leftside-navigation').height($('#main-content').height()+15)
|
||||||
var target = $('#lessonHelpsWrapper');
|
var target = $('#lessonHelpsWrapper');
|
||||||
goat.utils.scrollEasy(target);
|
goat.utils.scrollEasy(target);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user