flashgrid-ext 2.2.0 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51599e11b68a7eb4f5e0ab8c15833f79b4d3ac91
4
- data.tar.gz: b5d7e5d6b8c0cf3cb8e6d43de69f01c4275d21f0
3
+ metadata.gz: dc8a1562a0f9ca9b276bd7bef00f80e9d5a2531e
4
+ data.tar.gz: 13c4541874fa7f0485f119607e712edce102d9ce
5
5
  SHA512:
6
- metadata.gz: 9b3457406ff51c0f2723bd94342c65254bcc565bb726ad85ebcaea0a97c66929f3e642858dae24ab37d13bc57cb05030e02320e9c2916002974946fc38e58b06
7
- data.tar.gz: 905f684cd553fa25eb38ad116b545007e3581b1b142bc07187e39d5c5101dcbfb33578737e991704606520100b4622b2459d335680034c4dc20dac2e38a70a86
6
+ metadata.gz: ca8c0ef30b07bd35f87468b97cc56076962232c8c43cdc7e511d307fec60e09f46a78934f77d4694164d7bcdd3b44af6a5b3f6fd4479d061a70cc784d81c8b38
7
+ data.tar.gz: eef1e631a8cfbc71fd9b7fe18b0cdeacc3ce767fd016a100682ac55b1c39ff653cb1bc3ba68dcbfd1a345e1bcc674a7d0ac81576d9ee4a6866b934c67a94de80
@@ -1,5 +1,5 @@
1
1
  module Flashgrid
2
2
  module Ext
3
- VERSION = "2.2.0"
3
+ VERSION = "2.2.5"
4
4
  end
5
5
  end
@@ -81,6 +81,9 @@
81
81
  // Boolean - whether or not the chart should be responsive and resize when the browser does.
82
82
  responsive: true,
83
83
 
84
+ // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
85
+ maintainAspectRatio: true,
86
+
84
87
  // Boolean - Determines whether to draw tooltips on the canvas or not - attaches events to touchmove & mousemove
85
88
  showTooltips: true,
86
89
 
@@ -392,6 +395,12 @@
392
395
  //Templating methods
393
396
  //Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/
394
397
  template = helpers.template = function(templateString, valuesObject){
398
+ // If templateString is function rather than string-template - call the function for valuesObject
399
+ if(templateString instanceof Function)
400
+ {
401
+ return templateString(valuesObject);
402
+ }
403
+
395
404
  var cache = {};
396
405
  function tmpl(str, data){
397
406
  // Figure out if we're getting a template, or if we need to
@@ -683,11 +692,17 @@
683
692
  removeEvent(chartInstance.chart.canvas, eventName, handler);
684
693
  });
685
694
  },
686
- getMaximumSize = helpers.getMaximumSize = function(domNode){
695
+ getMaximumWidth = helpers.getMaximumWidth = function(domNode){
687
696
  var container = domNode.parentNode;
688
697
  // TODO = check cross browser stuff with this.
689
698
  return container.clientWidth;
690
699
  },
700
+ getMaximumHeight = helpers.getMaximumHeight = function(domNode){
701
+ var container = domNode.parentNode;
702
+ // TODO = check cross browser stuff with this.
703
+ return container.clientHeight;
704
+ },
705
+ getMaximumSize = helpers.getMaximumSize = helpers.getMaximumWidth, // legacy support
691
706
  retinaScale = helpers.retinaScale = function(chart){
692
707
  var ctx = chart.ctx,
693
708
  width = chart.canvas.width,
@@ -766,8 +781,8 @@
766
781
  resize : function(callback){
767
782
  this.stop();
768
783
  var canvas = this.chart.canvas,
769
- newWidth = getMaximumSize(this.chart.canvas),
770
- newHeight = newWidth / this.chart.aspectRatio;
784
+ newWidth = getMaximumWidth(this.chart.canvas),
785
+ newHeight = this.options.maintainAspectRatio ? newWidth / this.chart.aspectRatio : getMaximumHeight(this.chart.canvas);
771
786
 
772
787
  canvas.width = this.chart.width = newWidth;
773
788
  canvas.height = this.chart.height = newHeight;
@@ -1878,6 +1893,7 @@
1878
1893
  };
1879
1894
 
1880
1895
  }).call(this);
1896
+
1881
1897
  (function(){
1882
1898
  "use strict";
1883
1899
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flashgrid-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-16 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.3.0
89
+ rubygems_version: 2.4.1
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Flashgrid Extensions