SHARE
TWEET

Untitled

a guest May 21st, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // places, just being an array with atributes
  2. places.forEach(populateList());
  3.  
  4. function populateList() {
  5.   return (item, index) => {
  6.  
  7.     let $result = $(`.${baseClass}__result`);
  8.  
  9.     let $place_line = $("<p></p>");
  10.     $place_line.append( $("<a></a>").text(item.name).attr('href',item.url).attr('tabindex', index).addClass('place__name') );
  11.  
  12.     $place_line.append( $("<span></span>").text(item.rooms).addClass('place__attribute') );
  13.     $place_line.append( $("<span></span>").text(item.beds).addClass('place__attribute') );
  14.  
  15.     $place_line.append( $("<span></span>").text(item.conf).addClass('place__attribute') );
  16.     $place_line.append( $("<span></span>").text(item.group).addClass('place__attribute') );
  17.  
  18.     $result.append($place_line.addClass('place_line'));
  19.  
  20.   };
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top