Commit 0e2876a2 authored by Tibor Katelbach's avatar Tibor Katelbach

tweaks

parent 6e789d70
......@@ -842,6 +842,7 @@ var urlCtrl = {
}
return hash;
},
firstLoad : true,
jsController : function (hash){
mylog.log("jsController", hash);
hash = urlCtrl.checkAndConvert(hash);
......@@ -922,9 +923,19 @@ var urlCtrl = {
//go get the path , module is given in the hash
//console.log(">>>>>>>>>>>>>>>>>>> module path",path);
}
// console.log(">>>>>>>>>>>>>>>>>>> mod",mod,"> path : ",path,"> urlExtra : ",urlExtra,"> extraParams : ",extraParams);
// alert(baseUrl+'/'+ mod +path+urlExtra+extraParams);
showAjaxPanel( baseUrl+'/'+ mod +path+urlExtra+extraParams, endPoint.title,endPoint.icon, res,endPoint );
if(path == "dda" && extraParams != "" && urlCtrl.firstLoad ){
urlCtrl.afterLoad = function() {
extraParams = extraParams.substring(1);
extraParamsT = extraParams.split(".");
uiCoop.prepPreview(extraParamsT[0],extraParamsT[1],null,extraParamsT[2],extraParamsT[3],null);
}
}
}
urlCtrl.firstLoad = false;
if(endPoint.menu)
$("."+endPoint.menu).removeClass("hide");
......@@ -1131,7 +1142,7 @@ var urlCtrl = {
}else
showAjaxPanel( baseUrl+'/'+ moduleId + '/app/index', 'Home','home' );
}
});
} );
}else{
//if(typeof custom == "undefined" || typeof custom.url=="undefined")
showAjaxPanel( baseUrl+'/'+ moduleId + '/app/index', 'Home','home' );
......@@ -1144,21 +1155,21 @@ var urlCtrl = {
}
else
showAjaxPanel( baseUrl+'/'+ moduleId + '/app/index', 'Home','home' );
mylog.log("END loadByHash hash:", hash);
location.hash = hash;
if( location.hash.indexOf("#panel") >= 0 ){
panelName = location.hash.substr(7);
mylog.log("panelName",panelName);
if( userId == "" ){
if(panelName == "box-login")
Login.openLogin();
else if(panelName == "box-register")
$('#modalRegister').modal("show");
}
}
panelName = location.hash.substr(7);
mylog.log("panelName",panelName);
if( userId == "" ){
if(panelName == "box-login")
Login.openLogin();
else if(panelName == "box-register")
$('#modalRegister').modal("show");
}
}
/*if(typeof back == "function"){
alert("back");
back();
......
......@@ -672,68 +672,8 @@ function initPageTable(number){
var parentId = $(this).data("coop-parentid");
var parentType = $(this).data("coop-parenttype");
var afterLoad = null;
if( $(this).data("coop-section") ){
coopSection = $(this).data("coop-section");
if(coopSection == "amendments" ){
afterLoad = function() {
uiCoop.showAmendement(true);
if($("#form-amendement").hasClass("hidden"))
$("#form-amendement").removeClass("hidden");
else
$("#form-amendement").addClass("hidden");
};
} else if(coopSection == "vote" ){
mylog.log("HERE .openCoopPanelHtml vote");
afterLoad = function() {
setTimeout(function(){
$("#coop-container").animate({
scrollTop: $("#podVote").offset().top
}, 1000);
}, 1000);
};
}
else if(coopSection == "comments" ){
afterLoad = function() {
setTimeout(function(){
$("#coop-container").animate({
scrollTop: $(".btn-select-arg-comment").offset().top
}, 1000);
}, 1000);
};
}
}
coopType = coopType == "actions" ? "action" : coopType;
coopType = coopType == "proposals" ? "proposal" : coopType;
coopType = coopType == "resolutions" ? "resolution" : coopType;
console.log("HERE onclick coopPanelHtml", coopType, coopId, idParentRoom, parentId, parentType);
if(notNull(contextData) && contextData.id == parentId && contextData.type == parentType && typeof isOnepage == "undefined" && idParentRoom != ""){
toastr.info(trad["processing"]);
uiCoop.startUI();
$("#modalCoop").modal("show");
onchangeClick=false;
if(coopType == "rooms"){
uiCoop.getCoopData(contextData.type, contextData.id, "room", null, coopId);
}else{
setTimeout(function(){
uiCoop.getCoopData(contextData.type, contextData.id, "room", null, idParentRoom,
function(){
toastr.info(trad["processing"]);
uiCoop.getCoopData(contextData.type, contextData.id, coopType, null, coopId);
}, false);
}, 1000);
}
}else{
if(coopType == "rooms"){
var hash = "#page.type." + parentType + ".id." + parentId +
".view.coop.room." + idParentRoom + "."+coopType+"." + coopId;
urlCtrl.loadByHash(hash);
}else{
uiCoop.getCoopDataPreview(coopType, coopId, afterLoad);
}
}
location.hash="#dda?"+coopType+"."+coopId+"."+parentId+"."+parentType;
uiCoop.prepPreview(coopType,coopId,idParentRoom,parentId,parentType,afterLoad);
});
......
......@@ -217,7 +217,7 @@ dynForm = {
beforeBuild : function(){
//alert("before Build orga");
dyFObj.setMongoId('proposals', function(){
uploadObj.gotoUrl = '#page.type.proposals.id.'+uploadObj.id;
uploadObj.gotoUrl = '#dda'; //+uploadObj.id;
});
},
beforeSave : function(){
......@@ -278,6 +278,11 @@ dynForm = {
},
setTitle : function() {
$("#ajax-modal-modal-title").html(tradDynForm.addMeasure);
},
rename : function() {
$.each(custom.dynForm.proposal.onload.rename,function(k,v) {
$("."+k).html(v)
});
}
},
afterSave : function(data){
......
......@@ -169,22 +169,19 @@ var scrollEnd = false;
var currentKFormType = "";
jQuery(document).ready(function() {
initCountType();
var typeUrl = "?nopreload=true";
if(type!='') typeUrl = "?type="+type+"&nopreload=true";
//alert(baseUrl+'/'+moduleId+"/default/directoryjs"+typeUrl);
getAjax('#page' ,baseUrl+'/'+moduleId+"/default/directoryjs"+typeUrl,function(){
//anny double section filter directory
//anny double section filter directory
if(type=="all") searchAllEngine.initSearch();
loadingData = false;
initTypeSearch(type);
initSearchObject();
startSearch(searchObject.indexMin, null, searchCallback);
initSearchInterface();
},"html");
initSearchInterface();
......
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