Commit b5e7c1b0 authored by Clément Damiens's avatar Clément Damiens
Browse files

add direction on current container when refresh

parent a2e5660f
......@@ -178,10 +178,11 @@ class AppController extends CommunecterController {
}
public function actionPage($type, $id){
public function actionPage($type, $id, $view=null){
CO2Stat::incNbLoad("co2-page");
$params = array("id" => @$id,
"type" => @$type,
"view" => @$view,
"subdomain" => "page",
"mainTitle" => "Page perso",
"placeholderMainSearch" => "");
......
......@@ -20,6 +20,7 @@
var type = "<?php echo $type; ?>";
var id = "<?php echo $id; ?>";
var view = "<?php echo @$view; ?>";
var indexStepGS = 20;
jQuery(document).ready(function() {
......@@ -28,7 +29,7 @@ jQuery(document).ready(function() {
$("#mainNav").addClass("affix");
var tpl = '<?php echo @$_GET["tpl"] ? $_GET["tpl"] : "profilSocial"; ?>';
getAjax('#onepage' ,baseUrl+'/'+moduleId+"/element/detail/type/"+type+"/id/"+id+"?tpl="+tpl,function(){
getAjax('#onepage' ,baseUrl+'/'+moduleId+"/element/detail/type/"+type+"/id/"+id+"/view/"+view+"?tpl="+tpl,function(){
initPageInterface();
},"html");
});
......
......@@ -365,11 +365,24 @@
var dateLimit = 0;
var typeItem = "<?php echo $typeItem; ?>";
console.log("params", params);
var subView="<?php echo @$subview; ?>";
var hashUrlPage="#page.type."+contextType+".id."+contextId;
jQuery(document).ready(function() {
initSocial();
bindButtonMenu();
loadNewsStream(true);
if(subView!=""){
if(subView=="gallery")
loadGallery()
else if(subView=="notifications")
loadNotifications();
else if(subView.indexOf("chart") >= 0){
id=subView.split("chart");
loadChart(id[1]);
}
else if(subView=="mystream")
loadNewsStream(false);
} else
loadNewsStream(true);
});
......@@ -378,19 +391,30 @@
loadAdminDashboard();
});
$("#btn-start-newsstream").click(function(){
history.pushState(null, "New Title", hashUrlPage);
loadNewsStream(true);
});
$("#btn-start-mystream").click(function(){
if(contextType=="citoyens" && userId==contextId)
history.pushState(null, "New Title", hashUrlPage+".view.mystream");
else
history.pushState(null, "New Title", hashUrlPage);
loadNewsStream(false);
});
$("#btn-start-gallery").click(function(){
history.pushState(null, "New Title", hashUrlPage+".view.gallery");
//location.search="?view=gallery";
loadGallery();
});
$("#btn-start-notifications").click(function(){
history.pushState(null, "New Title", hashUrlPage+".view.notifications");
//location.search="?view=notifications";
loadNotifications();
});
$(".btn-start-chart").click(function(){
id=$(this).data("value");
history.pushState(null, "New Title", hashUrlPage+".view.chart"+id);
//location.search="?view=chart&id="+id;
loadChart(id);
});
}
......
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