Permalink
Browse files

BUGFIX: module working in SilverStripe 3

  • Loading branch information...
1 parent 74c5f72 commit 5bf37531f55d75cc6e7dd4305f95e936a6304ef6 Julian Seidenberg committed Sep 25, 2012
Showing with 12 additions and 10 deletions.
  1. +1 −1 code/GoogleAnalyzer.php
  2. +1 −1 code/GooglePerformanceChart.php
  3. +10 −8 javascript/GooglePerformanceChart.js
View
@@ -43,7 +43,7 @@ public static function activate($profile = 'SiteConfig', $email = null, $passwor
self::$email = $email;
self::$password = $password;
}
- SS_Report::register("ReportAdmin", "GoogleReport");
+
Object::add_extension('SiteTree', 'GoogleAnalyzer');
}
@@ -12,7 +12,7 @@ function __construct($page = null) {
}
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
return $this->renderWith('GooglePerformanceChart');
}
@@ -187,21 +187,23 @@
}
function maxPaneSize() {
- var avail = new Array($('#Stats_Performance').innerHeight(), $('#Stats_Performance').innerWidth());
+ var avail = new Array(500, 640); //size of the chart to use
var offset = new Array($('#GooglePerformanceChartOverview').outerHeight(), $('#GooglePerformanceChartOverview').outerWidth());
var max = new Array(avail[0] - offset[0] - 40, avail[1] - 20);
var current = new Array($('#GooglePerformanceChart').height(), $('#GooglePerformanceChart').width());
if(max[0] != current[0]) $('#GooglePerformanceChart').height(max[0]);
if(max[1] != current[1]) $('#GooglePerformanceChart').width(max[1]);
}
- $('#GooglePerformanceChart').livequery(function(){
- initPlotter();
- plotAccordingToChoices();
-
- // maximize the graph
- setInterval(maxPaneSize, 1000);
- })
+ $("#GooglePerformanceChart").entwine({
+ onmatch: function() {
+ initPlotter();
+ plotAccordingToChoices();
+ // maximize the graph
+ setInterval(maxPaneSize, 2000);
+ }
+ });
});
+
})(jQuery);

0 comments on commit 5bf3753

Please sign in to comment.