app/assets/javascripts/highcharts/modules/exporting.js in highcharts-rails-3.0.1.5 vs app/assets/javascripts/highcharts/modules/exporting.js in highcharts-rails-3.0.2
- old
+ new
@@ -1,7 +1,7 @@
/**
- * @license Highcharts JS v3.0.1 (2013-04-09)
+ * @license Highcharts JS v3.0.2 (2013-06-05)
* Exporting module
*
* (c) 2010-2013 Torstein Hønsi
*
* License: www.highcharts.com/license
@@ -241,12 +241,11 @@
forExport: true,
width: sourceWidth,
height: sourceHeight
});
options.exporting.enabled = false; // hide buttons in print
- options.chart.plotBackgroundImage = null; // the converter doesn't handle images
-
+
// prepare for replicating the chart
options.series = [];
each(chart.series, function (serie) {
seriesOptions = merge(serie.options, {
animation: false, // turn off animation
@@ -308,11 +307,11 @@
.replace(/<IMG /g, '<image ')
.replace(/height=([^" ]+)/g, 'height="$1"')
.replace(/width=([^" ]+)/g, 'width="$1"')
.replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
.replace(/id=([^" >]+)/g, 'id="$1"')
- .replace(/class=([^" ]+)/g, 'class="$1"')
+ .replace(/class=([^" >]+)/g, 'class="$1"')
.replace(/ transform /g, ' ')
.replace(/:(path|rect)/g, '$1')
.replace(/style="([^"]+)"/g, function (s) {
return s.toLowerCase();
});
@@ -337,15 +336,15 @@
var chart = this,
chartExportingOptions = chart.options.exporting,
svg = chart.getSVG(merge(
{ chart: { borderRadius: 0 } },
- chartExportingOptions,
+ chartExportingOptions.chartOptions,
chartOptions,
{
exporting: {
- sourceWidth: options.sourceWidth ||Â chartExportingOptions.sourceWidth, // docs: option and parameter in exportChart()
+ sourceWidth: options.sourceWidth || chartExportingOptions.sourceWidth, // docs: option and parameter in exportChart()
sourceHeight: options.sourceHeight || chartExportingOptions.sourceHeight // docs
}
}
));
@@ -463,10 +462,11 @@
hide = function () {
css(menu, { display: NONE });
if (button) {
button.setState(0);
}
+ chart.openMenu = false;
};
// Hide the menu some time after mouse leave (#1357)
addEvent(menu, 'mouseleave', function () {
hideTimer = setTimeout(hide, 500);
@@ -524,10 +524,11 @@
} else {
menuStyle.top = (y + height - menuPadding) + PX;
}
css(menu, menuStyle);
+ chart.openMenu = true;
},
/**
* Add the export button to the chart
*/
@@ -643,12 +644,15 @@
elem;
// Destroy the extra buttons added
for (i = 0; i < chart.exportSVGElements.length; i++) {
elem = chart.exportSVGElements[i];
+
// Destroy and null the svg/vml elements
- elem.onclick = elem.ontouchstart = null;
- chart.exportSVGElements[i] = elem.destroy();
+ if (elem) { // #1822
+ elem.onclick = elem.ontouchstart = null;
+ chart.exportSVGElements[i] = elem.destroy();
+ }
}
// Destroy the divs for the menu
for (i = 0; i < chart.exportDivElements.length; i++) {
elem = chart.exportDivElements[i];