#296 updates href according to to page nav
This commit is contained in:
parent
025ac49e19
commit
35055eeb3c
@ -13,26 +13,14 @@ define(['jquery',
|
|||||||
items:null,
|
items:null,
|
||||||
selectedItem:null
|
selectedItem:null
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function (options) {
|
initialize: function (options) {
|
||||||
//this.scrParam = null;
|
|
||||||
//this.menuParam = null;
|
|
||||||
//this.stageParam = null;
|
|
||||||
//this.numParam = null;
|
|
||||||
//this.baseUrlRoot = '';
|
|
||||||
},
|
},
|
||||||
|
|
||||||
loadData: function(options) {
|
loadData: function(options) {
|
||||||
this.urlRoot = _.escape(encodeURIComponent(options.name)) + '.lesson'
|
this.urlRoot = _.escape(encodeURIComponent(options.name)) + '.lesson'
|
||||||
// if (options.stage != null) {
|
|
||||||
// this.urlRoot += '&stage=' + options.stage;
|
|
||||||
// }
|
|
||||||
// if (options.num != null) {
|
|
||||||
// this.urlRoot += '&Num=' + options.num;
|
|
||||||
// }
|
|
||||||
//TODO - is below needed anymore?
|
|
||||||
// this.set('menuParam', options.menu);
|
|
||||||
// this.set('scrParam', options.scr);
|
|
||||||
// this.set('stageParam', options.stage);
|
|
||||||
// this.set('numParam', options.num);
|
|
||||||
var self = this;
|
var self = this;
|
||||||
this.fetch().done(function(data) {
|
this.fetch().done(function(data) {
|
||||||
self.setContent(data);
|
self.setContent(data);
|
||||||
@ -44,6 +32,7 @@ define(['jquery',
|
|||||||
loadHelps = true;
|
loadHelps = true;
|
||||||
}
|
}
|
||||||
this.set('content',content);
|
this.set('content',content);
|
||||||
|
this.set('lessonUrl',document.URL);
|
||||||
this.trigger('content:loaded',this,loadHelps);
|
this.trigger('content:loaded',this,loadHelps);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ define(['jquery',
|
|||||||
'test/:param':'testRoute'
|
'test/:param':'testRoute'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
lessonController: new LessonController({
|
lessonController: new LessonController({
|
||||||
lessonContentView: lessonContentView
|
lessonContentView: lessonContentView
|
||||||
}),
|
}),
|
||||||
@ -84,10 +83,6 @@ define(['jquery',
|
|||||||
this.lessonController.loadWelcome();
|
this.lessonController.loadWelcome();
|
||||||
});
|
});
|
||||||
|
|
||||||
goatRouter.on('route:welcomeRoute', function() {
|
|
||||||
this.lessonController.loadWelcome();
|
|
||||||
});
|
|
||||||
|
|
||||||
goatRouter.on('route:testRoute', function(param) {
|
goatRouter.on('route:testRoute', function(param) {
|
||||||
this.lessonController.testHandler(param);
|
this.lessonController.testHandler(param);
|
||||||
});
|
});
|
||||||
|
@ -168,7 +168,8 @@ define(['jquery',
|
|||||||
incrementPageView: function() {
|
incrementPageView: function() {
|
||||||
if (this.currentPage < this.numPages -1) {
|
if (this.currentPage < this.numPages -1) {
|
||||||
this.currentPage++;
|
this.currentPage++;
|
||||||
this.showCurContentPage(true);
|
window.location.href = this.model.get('lessonUrl') + '/' + this.currentPage;
|
||||||
|
//this.showCurContentPage(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.currentPage > 0) {
|
if (this.currentPage > 0) {
|
||||||
@ -184,7 +185,8 @@ define(['jquery',
|
|||||||
decrementPageView: function() {
|
decrementPageView: function() {
|
||||||
if (this.currentPage > 0) {
|
if (this.currentPage > 0) {
|
||||||
this.currentPage--;
|
this.currentPage--;
|
||||||
this.showCurContentPage(false);
|
window.location.href = this.model.get('lessonUrl') + '/' + this.currentPage;
|
||||||
|
//this.showCurContentPage(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.currentPage < this.numPages -1) {
|
if (this.currentPage < this.numPages -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user