From 4e55e976aec6ba87a7519816ec8dae52f2740b3a Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Fri, 4 May 2018 22:27:01 +0200 Subject: [PATCH] =?UTF-8?q?:bug:=20Ajoute=20une=20m=C3=A9thode=20d'instanc?= =?UTF-8?q?e=20sur=20la=20classe=20Piwik=20pour=20uniformiser=20le=20proto?= =?UTF-8?q?cole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/Tracker.js | 9 ++++++++- source/entry-colour-chooser.js | 6 +++--- source/entry.prod.js | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/components/Tracker.js b/source/components/Tracker.js index f82c19536..eb05a93c1 100644 --- a/source/components/Tracker.js +++ b/source/components/Tracker.js @@ -13,7 +13,10 @@ export default class Piwik { this.options = options - if (this.options.url === undefined || this.options.siteId === undefined) { + if ( + this.options.url === undefined || + this.options.siteId === undefined + ) { throw new Error( 'PiwikTracker cannot be initialized! SiteId and url are mandatory.' ) @@ -64,6 +67,10 @@ export default class Piwik { window._paq.push(args) // eslint-disable-line no-underscore-dangle } + push(args) { + Piwik.push(args) + } + connectToHistory(history) { this.unlistenFromHistory = history.listen(loc => { this.track(loc) diff --git a/source/entry-colour-chooser.js b/source/entry-colour-chooser.js index cbc30dea3..0d694e0d5 100644 --- a/source/entry-colour-chooser.js +++ b/source/entry-colour-chooser.js @@ -29,8 +29,8 @@ class MyComponent extends React.Component { return (

- Visualisez sur cette page l’apparence du module pour différentes - couleurs principales. + Visualisez sur cette page l’apparence du module pour + différentes couleurs principales.

{this.props.couleur}

- +
) } diff --git a/source/entry.prod.js b/source/entry.prod.js index 066001409..55f0ad95c 100644 --- a/source/entry.prod.js +++ b/source/entry.prod.js @@ -40,7 +40,7 @@ let anchor = document.querySelector('#js') render( - + , anchor )