Commit df244272 authored by Gabriel Monnerat's avatar Gabriel Monnerat

- Add condition to don't display the search view if SearchableText is blank

- improve view of search results

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42939 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca50790a
...@@ -296,6 +296,8 @@ $(document).ready(function() { \n ...@@ -296,6 +296,8 @@ $(document).ready(function() { \n
});\n });\n
$("input#submit-search").click(function(event){\n $("input#submit-search").click(function(event){\n
event.preventDefault();\n event.preventDefault();\n
if ($("input[name=\'searchable-text\']").val() == "")\n
return false;\n
$("div#dvCalMain.calmain div#gridcontainer").css("background", "none repeat scroll 0 0 #FFFFFF");\n $("div#dvCalMain.calmain div#gridcontainer").css("background", "none repeat scroll 0 0 #FFFFFF");\n
$("div#dvwkcontaienr.wktopcontainer").hide();\n $("div#dvwkcontaienr.wktopcontainer").hide();\n
$("div#gridcontainer div#dvtec.scolltimeevent").hide();\n $("div#gridcontainer div#dvtec.scolltimeevent").hide();\n
...@@ -324,16 +326,23 @@ $(document).ready(function() { \n ...@@ -324,16 +326,23 @@ $(document).ready(function() { \n
var currentDate = new Date();\n var currentDate = new Date();\n
for (var i = 0; i < eventList.length; i++){\n for (var i = 0; i < eventList.length; i++){\n
var eventDate = new Date(eventList[i][2]);\n var eventDate = new Date(eventList[i][2]);\n
var hourSymbol = "am";\n
if (eventDate.getMonth() == currentDate.getMonth() && eventDate.getDate() == currentDate.getDate()){\n if (eventDate.getMonth() == currentDate.getMonth() && eventDate.getDate() == currentDate.getDate()){\n
eventTableList.push("<tr id=\'today-event\'>");\n eventTableList.push("<tr id=\'today-event\'>");\n
}\n }\n
else {\n else {\n
eventTableList.push("<tr>");\n eventTableList.push("<tr>");\n
}\n }\n
eventTableList.push("<td>");\n var dateSplitted = eventList[i][2].split(" ");\n
eventTableList.push(eventList[i][2]);\n if (eventDate.getHours() >= 12)\n
eventTableList.push("</td><td>");\n hourSymbol = "pm";\n
eventTableList.push(eventList[i][1]);\n eventTableList.push("<td id=\'event-date\'>");\n
eventTableList.push(dateSplitted[0]);\n
eventTableList.push("</td>");\n
eventTableList.push("<td id=\'time-range\'>", \n
dateSplitted[1] + hourSymbol,\n
"</td>");\n
eventTableList.push("<td>", eventList[i][1]);\n
eventTableList.push("</td></tr>");\n eventTableList.push("</td></tr>");\n
}\n }\n
$("div.event-listview tbody").append(eventTableList.join(""));\n $("div.event-listview tbody").append(eventTableList.join(""));\n
......
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