Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(){
- var sections = jQuery('#icons').children();
- var collector = [];
- sections.each(function(){
- var that = jQuery(this);
- if(that.attr('id') !== 'new'){
- jQuery(this).find('i').filter(function(){ return !jQuery(this).siblings('.text-muted').length }).each(function(){
- var obj = {};
- found = _.findWhere(collector, {'icon': jQuery(this).attr('class').replace('fa fa-', '') });
- if(found !== undefined){
- found.category.push(that.attr('id'));
- return;
- }
- obj['icon'] = jQuery(this).attr('class').replace('fa fa-', '');
- obj['category']= [];
- obj['category'].push(that.attr('id'));
- collector.push(obj);
- });
- }
- });
- console.log('Length', collector.length);
- console.log(JSON.stringify(collector));
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement