googleanalytics.js
4 years ago
googleanalytics_createprop.js
4 years ago
googleanalytics_dashboard.js
4 years ago
googleanalytics_page.js
3 years ago
googleanalytics.js
31 lines
| 1 | /** |
| 2 | * Google Analytics loader script. |
| 3 | * |
| 4 | * @package GoogleAnalytics |
| 5 | */ |
| 6 | |
| 7 | (function ($) { |
| 8 | ga_loader = { |
| 9 | show: function () { |
| 10 | $( '.ga-loader' ).show(); |
| 11 | }, |
| 12 | hide: function () { |
| 13 | $( '.ga-loader' ).hide(); |
| 14 | } |
| 15 | }; |
| 16 | |
| 17 | ga_tools = { |
| 18 | getCurrentWidth: function (wrapperSelector) { |
| 19 | return $( wrapperSelector ).width(); |
| 20 | }, |
| 21 | recomputeChartWidth: function (minWidth, offset, wrapperSelector) { |
| 22 | const currentWidth = ga_tools.getCurrentWidth( wrapperSelector ); |
| 23 | if (currentWidth >= minWidth) { |
| 24 | return parseInt( currentWidth - offset ); |
| 25 | } else { |
| 26 | return minWidth; |
| 27 | } |
| 28 | } |
| 29 | }; |
| 30 | })( jQuery ); |
| 31 |