Commit 90939760 authored by Raph El's avatar Raph El

Hotfix

parent 1e4d8959
......@@ -1391,6 +1391,7 @@ var urlCtrl = {
historyReplace=false;
},
bindCoNav : function(){
mylog.log("urlCtrl.bindCoNav");
document.onmouseover = function() {
//User's mouse is inside the page.
window.innerDocClick = true;
......@@ -1401,13 +1402,14 @@ var urlCtrl = {
window.innerDocClick = false;
}
window.onhashchange = function() {
mylog.log("urlCtrl.bindCoNav window.onhashchang");
if (!window.innerDocClick) {
//Browser back button was clicked
searchObject.reset();
searchObject.text="",
searchObject.tags=[];
onchangeClick=true;
console.log("reseeeeetObject search", searchObject);
mylog.log("urlCtrl.bindCoNav search", searchObject);
}
mylog.warn("popstate history.state",history.state);
if( lastWindowUrl && "onhashchange" in window){
......
This diff is collapsed.
This diff is collapsed.
......@@ -490,7 +490,7 @@ var searchInterface={
/* ----------------------------
SEARCH ENGINE
-------------------------------*/
constructObjectAndUrl: function(){
constructObjectAndUrl: function(notUrl){
mylog.log("searchInterface.constructObjectAndUrl", searchObject);
getStatus="";
var searchConstruct={};
......@@ -557,7 +557,11 @@ var searchInterface={
searchConstruct.locality = getSearchLocalityObject();
searchInterface.countActiveFilters();
//Construct url with all necessar params
urlCtrl.manageHistory();
if(typeof notUrl == "undefined" ||
notUrl == null ||
notUrl == false)
urlCtrl.manageHistory();
return searchConstruct;
},
getUrlSearchParams : function(extraParams=["nbPage"], checkForced=true){
......@@ -1084,51 +1088,22 @@ var searchAllEngine = {
if(!loadingData && !scrollEnd && !isMapEnd /* && typeof searchObject.ranges != "undefined" */){
var heightWindow = $("html").height();// - $("body").height();
if( $(this).scrollTop() >= heightWindow - 1200){
startSearch(10, 30, null);
}
}
});
},
initSearchEvent: function (){
mylog.log("searchAllEngine.initSearchEvent");
//Search on all
//searchAllEngine.initRanges();
//searchAllEngine.allResults={};
mylog.log("searchAllEngine.initSearchEvent");
if(typeof searchObject.nbPage != "undefined") delete searchObject.nbPage;
pageCount=false;
scrollEnd=false;
$(window).bind("scroll",function(){
if(!loadingData && !scrollEnd && !isMapEnd && !searchAllEngine.searchInProgress){
var heightWindow = $("html").height();
if($(window).scrollTop() + $(window).height() > $(document).height() - 200) {
mylog.log("searchAllEngine.initSearch scroll", loadingData, scrollEnd, isMapEnd, typeof searchObject.ranges );
if(typeof dayCount != "undefined" && searchObject.types.length == 1 && $.inArray( "events", searchObject.types) >= 0){
dayCount++;
var startMoment = moment(STARTDATE).set('date', moment(STARTDATE).get('date')+dayCount).format();
var strdate = '<div class="col-xs-12">'+
'<div class="dayEvent col-xs-12">'+
'<h2 class="text-white date" style="text-transform:inherit;padding-left:15px;">'+
'<i class="fa fa-angle-down"></i> <span class="date-label">'+moment(startMoment).locale("fr").format('dddd DD MMMM')
'</span></h2>'+
'</div>'+
'</div>';
//mylog("testAgenda", STARTDATE, moment(STARTDATE).format(), )
$("#dropdown_search").append(strdate);
var startDDDD = new Date(startMoment);
searchObject.startDate = Math.floor(startDDDD / 1000);
startSearch(10, 30, null);
}
}
}
});
agenda.scroll();
},
prepareAllSearch: function(data){
mylog.log("searchAllEngine.prepareAllSearch", data, searchAllEngine);
sorting=[];
searchObject.types=[];
//searchObject.types=[];
$i=0;
resToShow={};
searchAllEngine.initInjectData();
......@@ -1136,9 +1111,9 @@ var searchAllEngine = {
searchAllEngine.allResults[e]=v;
});
$.each(searchAllEngine.allResults, function(e,v ){
typeKey=(v.type=="organizations") ? v.typeOrga : v.type;
if (searchObject.types.indexOf(typeKey) == -1)
searchObject.types.push(typeKey);
// typeKey=(v.type=="organizations") ? v.typeOrga : v.type;
// if (searchObject.types.indexOf(typeKey) == -1)
// searchObject.types.push(typeKey);
sorting.push(v.sorting);
//mylog.log("searchAllEngine.prepareAllSearch searchObject.types", searchObject.types);
......
......@@ -223,6 +223,7 @@ class CommunecterController extends Controller
"getmemberautocomplete" => array("href" => "/ph/co2/search/getmemberautocomplete"),
"getshortdetailsentity" => array("href" => "/ph/co2/search/getshortdetailsentity"),
"index" => array("href" => "/ph/co2/search/index"),
"geteventsforcalendar" => array("href" => "/ph/co2/search/geteventsforcalendar"),
"mainmap" => array("href" => "/ph/co2/default/mainmap", "public" => true)
),
"network" => array(
......
......@@ -23,6 +23,7 @@ class SearchController extends CommunecterController {
'searchbycriteria' => 'citizenToolKit.controllers.search.SearchByCriteriaAction',
'index' => 'citizenToolKit.controllers.search.IndexAction',
'mainmap' => 'citizenToolKit.controllers.search.MainMapAction',
'geteventsforcalendar' => 'citizenToolKit.controllers.search.GetEventsForCalendarAction',
);
}
}
\ No newline at end of file
......@@ -62,24 +62,36 @@ if(isset(Yii::app()->session["costum"]) && !empty($calendarParams)){
<a href='javascript:;' id='showHideCalendar' class='text-azure' data-hidden='0'><i class='fa fa-caret-up'></i> Hide calendar</a>
</div> -->
<div id='profil-content-calendar' class='col-xs-12 margin-bottom-20'></div>
<div class="col-xs-12">
<!-- <div class="col-xs-12">
<div id='situate-day' class="col-xs-12">
<h2 class="text-white date" style="text-transform:inherit;padding-left:15px;"><i class="fa fa-angle-down"></i> <span class="date-label"><?php echo Yii::t("common","Coming events"); ?></span></h2>
<h2 class="text-white date" style="text-transform:inherit;padding-left:15px;"><i class="fa fa-angle-down"></i> <span class="date-label"><?php //echo Yii::t("common","Coming events"); ?></span></h2>
</div>
</div>
</div> -->
</div>
<script type="text/javascript">
/*function showResultInCalendar(mapElements){
calendar.init("#profil-content-calendar");
//$("#profil-content-calendar").fullCalendar('destroy');
/*$(window).on('resize', function(){
$("#profil-content-calendar").fullCalendar('destroy');
calendar.showCalendar("#profil-content-calendar", mapElements, "month");
jQuery(document).ready(function() {
mylog.log("calendar.php");
var paramsSearchCalendar=searchInterface.constructObjectAndUrl();
$.ajax({
type: "POST",
url: baseUrl+"/" + moduleId + "/search/geteventsforcalendar/startDate/1577995200/endDate/1580673600",
data: paramsSearchCalendar,
dataType: "json",
error: function (data){
mylog.log("calendar.php globalautocomplete error", data);
},
success: function(data){
mylog.log("calendar.php globalautocomplete success", data);
if(!data){
toastr.error(data.content);
} else {
if(typeof calendar != "undefined" && searchObject.initType == "events" && searchObject.text=="")
calendar.addEvents(data.events);
}
}
});
}*/
});
</script>
\ No newline at end of file
......@@ -291,20 +291,13 @@ jQuery(document).ready(function() {
if(window.location.href.indexOf("#agenda") == -1)
window.history.pushState({},"", window.location.href+"#agenda");
calculateAgendaWindow(0);
calendar.init("#profil-content-calendar");
if(typeof calendar != "undefined")
calendar.init("#profil-content-calendar");
}
// var paramsMapCO = {
// container : "mapContent",
// hideContainer : "content-social",
// activePopUp : true,
// tile : "mapbox",
// menuRight : true,
// btnHide : true
// // mapOpt:{
// // latLon : ["47.482649", "2.431357"]
// // }
// };
// mapCO = mapObj.init(paramsMapCO);
startSearch(searchObject.indexMin, null, searchCallback);
$(".tooltips").tooltip();
......
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