Commit r2376: https://sourceforge.net/p/mrbs/code/2376/
------------------------------------------------------------------------
r2376 | cimorrison | 2012-08-12 20:48:31 +0100 (Sun, 12 Aug 2012) | 1 line
Changed paths:
M /mrbs/trunk/web/js/refresh.js.php
Fixed bug introduced in last revision where refreshing wasn't disabled if
$refresh_rate equals zero
------------------------------------------------------------------------
Index: mrbs/trunk/web/js/refresh.js.php
===================================================================
--- mrbs/trunk/web/js/refresh.js.php (revision 2375)
+++ mrbs/trunk/web/js/refresh.js.php (revision 2376)
@@ -18,33 +18,39 @@
init = function(args) {
oldInitRefresh.apply(this, [args]);
- var data = {ajax: 1,
- day: args.day,
- month: args.month,
- year: args.year,
- room: args.room,
- area: args.area};
- if (args.timetohighlight !== undefined)
+ <?php
+ if (!empty($refresh_rate))
{
- data.timetohighlight = args.timetohighlight;
- }
- var table = $('table.dwm_main');
- <?php // setTimeout not setInterval because the 'load' trigger restarts us ?>
- window.setTimeout(function() {
- $.post(args.page + '.php',
- data,
- function(result){
- <?php
- // (1) Empty the existing table in order to get rid of events
- // and data and prevent memory leaks (2) insert the updated
- // table HTML and then (3) trigger a window load event so
that
- // the resizable bookings are re-created
- ?>
- table.empty()
- table.html(result);
- $(window).trigger('load');
- },
- 'html');
- }, <?php echo $refresh_rate * 1000 ?>);
-
+ ?>
+ var data = {ajax: 1,
+ day: args.day,
+ month: args.month,
+ year: args.year,
+ room: args.room,
+ area: args.area};
+ if (args.timetohighlight !== undefined)
+ {
+ data.timetohighlight = args.timetohighlight;
+ }
+ var table = $('table.dwm_main');
+ <?php // setTimeout not setInterval because the 'load' trigger restarts us
?>
+ window.setTimeout(function() {
+ $.post(args.page + '.php',
+ data,
+ function(result){
+ <?php
+ // (1) Empty the existing table in order to get rid of
events
+ // and data and prevent memory leaks (2) insert the updated
+ // table HTML and then (3) trigger a window load event so
that
+ // the resizable bookings are re-created
+ ?>
+ table.empty()
+ table.html(result);
+ $(window).trigger('load');
+ },
+ 'html');
+ }, <?php echo $refresh_rate * 1000 ?>);
+ <?php
+ } // if (!empty($refresh_rate))
+ ?>
}
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits