Commit 2e8e6bac authored by FloBen's avatar FloBen
Browse files

fix form wizard undefined
parent f240d7ba
......@@ -241,11 +241,14 @@ var tplCtx = {};
if(location.hash.indexOf("#answer.index.id.new")>=0){
history.replaceState("#answer.index.id.new", "", "#answer.index.id."+answerId+".mode."+mode);
}
var strListMode = "";
var strLowListMode = "";
var strArrowTop = "";
jQuery(document).ready(function() {
mylog.log("render","modules/survey/views/tpls/forms/formWizard.php");
var strListMode = "";
if(typeof pageProfil != "undefined" && typeof pageProfil.form != "undefined" && pageProfil.form != null){
if(mode == "w")
strListMode = '<a href="javascript:;" data-id="'+answerId+'" data-mode="r" data-form="'+form._id.$id+'" class="btnAnswer btn btn-primary pull-right">Lecture Seule</a>';
......@@ -265,25 +268,29 @@ jQuery(document).ready(function() {
}
}
$("#modeSwitch").html(strListMode);
$(document).on('scroll',function(){
var scrollTop = $(window).scrollTop();
if (scrollTop > 100) {
$("#bottomModeSwitch").html(strLowListMode);
coInterface.bindLBHLinks();
}
else{
$("#bottomModeSwitch").empty();
}
if(scrollTop > 500){
$("#arrowTop").html(strArrowTop);
coInterface.bindLBHLinks();
}else{
$("#arrowTop").empty();
}
});
if(strLowListMode!="" && strArrowTop!=""){
$(document).on('scroll',function(){
var scrollTop = $(window).scrollTop();
if (scrollTop > 100) {
$("#bottomModeSwitch").html(strLowListMode);
coInterface.bindLBHLinks();
}
else{
$("#bottomModeSwitch").empty();
}
if(scrollTop > 500){
$("#arrowTop").html(strArrowTop);
coInterface.bindLBHLinks();
}else{
$("#arrowTop").empty();
}
});
}
$("#arrowTop").off().on("click",function(){
scrollintoDiv("wizardLinks",2000);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment