Skip to content

Commit

Permalink
Refactoring, implemented regex expression instead of string functions
Browse files Browse the repository at this point in the history
  • Loading branch information
NeXTs committed Aug 8, 2015
1 parent c4ab015 commit 13de88c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
11 changes: 4 additions & 7 deletions clusterize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Clusterize.js - v0.10.0 - 2015-08-05
/*! Clusterize.js - v0.10.1 - 2015-08-08
* http://NeXTs.github.com/Clusterize.js/
* Copyright (c) 2015 Denis Lukov; Licensed MIT */

Expand Down Expand Up @@ -168,12 +168,9 @@
var opts = this.options;
opts.content_tag = this.content_elem.tagName.toLowerCase();
if( ! rows.length) return;
if(ie && ie <= 9 && ! opts.tag) opts.tag = rows[0].split('<')[1].split(' ')[0].split('>')[0].toLowerCase();
if(this.content_elem.children.length <= 1 || ! opts.tag) {
this.html(rows[0] + rows[0] + rows[0]);
var node = this.content_elem.children[1];
if( ! opts.tag) opts.tag = node.tagName.toLowerCase();
}
if(ie && ie <= 9 && ! opts.tag) opts.tag = rows[0].match(/<([^>\s/]*)/)[1].toLowerCase();
if(this.content_elem.children.length <= 1) this.html(rows[0] + rows[0] + rows[0]);
if( ! opts.tag) opts.tag = this.content_elem.children[0].tagName.toLowerCase();
this.getRowsHeight(rows);
},
getRowsHeight: function(rows) {
Expand Down
10 changes: 5 additions & 5 deletions clusterize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clusterize.js",
"version": "0.10.0",
"version": "0.10.1",
"description": "Tiny vanilla JS plugin to display large data sets easily",
"main": "clusterize.js",
"style": "clusterize.css",
Expand Down

0 comments on commit 13de88c

Please sign in to comment.