From c6623291b6e5c17a77bb16e488179cba7afe140c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 12 Jan 2016 21:47:35 +0000 Subject: [PATCH] Linting --- static/src/js/components/breadcrumbs.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/static/src/js/components/breadcrumbs.js b/static/src/js/components/breadcrumbs.js index 067f28b..dd24ceb 100644 --- a/static/src/js/components/breadcrumbs.js +++ b/static/src/js/components/breadcrumbs.js @@ -1,29 +1,25 @@ import React from 'react'; export default class Breadcrumbs extends React.Component { - constructor() { - super(); - this.urlParts = Object.freeze(location.pathname.split('/').slice(1, -1)); - } - render() { - if (this.urlParts.length < 2) { + const urlParts = Object.freeze(location.pathname.split('/').slice(1, -1)); + if (urlParts.length < 2) { return; } var elements = []; - for (var i = 0; i < this.urlParts.length; i++) { + for (var i = 0; i < urlParts.length; i++) { var dirs = []; for (var j = 0; j <= i; j++) { - dirs.push(this.urlParts[j]); + dirs.push(urlParts[j]); } - if (i === (this.urlParts.length - 1)) { + if (i === (urlParts.length - 1)) { elements.push( -
  • {this.urlParts[i]}
  • +
  • {urlParts[i]}
  • ); } else { var url = '/' + dirs.join('/') + '/'; elements.push( -
  • {this.urlParts[i]}
  • +
  • {urlParts[i]}
  • ); } }