Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
refs opencomponents#436 Reverted const/let changes to browser files
Browse files Browse the repository at this point in the history
  • Loading branch information
elboletaire committed Apr 8, 2017
1 parent 782a916 commit 52b17b2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
7 changes: 4 additions & 3 deletions src/registry/views/static/component-info.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
/* eslint no-var: 'off' */

const oc = oc || {};
var oc = oc || {};
oc.cmd = oc.cmd || [];

oc.cmd.push(function(){
Expand All @@ -11,8 +12,8 @@ oc.cmd.push(function(){

$('.refresh-preview').click(function(){

let url = splitted[0];
const splitted = $('#href').val().split('?'),
var splitted = $('#href').val().split('?'),
url = splitted[0],
lang = $('#lang').val();

if(url.slice(-1) !== '/'){
Expand Down
25 changes: 13 additions & 12 deletions src/registry/views/static/list-components.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
'use strict';
/* eslint no-var: 'off' */

const oc = oc || {};
var oc = oc || {};
oc.cmd = oc.cmd || [];

oc.cmd.push(function(){

const componentsListChanged = function(){
var componentsListChanged = function(){
$('.componentRow').removeClass('hide');
const s = $('.search').val(),
var s = $('.search').val(),
r = new RegExp(s),
selectedCheckboxes = $('input[type=checkbox]:checked'),
hiddenStates = [];
let hidden = 0,
hiddenStates = [],
hidden = 0,
i;

for(i = 0; i < selectedCheckboxes.length; i++){
hiddenStates.push($(selectedCheckboxes[i]).attr('name'));
}

for(i = 0; i < componentsList.length; i++){
const matches = !s || !!componentsList[i].name.match(r),
selector = $('#component-' + componentsList[i].name);
let isHidden = false;
var matches = !s || !!componentsList[i].name.match(r),
selector = $('#component-' + componentsList[i].name),
isHidden = false;

for(let j = 0; j < hiddenStates.length; j++){
for(var j = 0; j < hiddenStates.length; j++){
if(componentsList[i].state.toLowerCase() === hiddenStates[j]){
isHidden = true;
}
}

const show = matches && !isHidden;
var show = matches && !isHidden;
selector[show ? 'removeClass' : 'addClass']('hide');
if(!show){
hidden += 1;
}
}

const totalShowing = componentsList.length - hidden;
let result = 'Showing ' + totalShowing + ' components';
var totalShowing = componentsList.length - hidden,
result = 'Showing ' + totalShowing + ' components';

if(s){
result += ' matching search query: ' + s;
Expand Down

0 comments on commit 52b17b2

Please sign in to comment.