SHARE
TWEET

Untitled

a guest Sep 16th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const DOM_SELECTORS = {
  2.   searchForm: () => document.querySelector('.search'),
  3.   searchInput: () => document.querySelector('.search__field'),
  4.   searchResults: () => document.querySelector('.results'),
  5.   searchResultsList: () => document.querySelector('.results__list'),
  6.   searchResultsPages: () => document.querySelector('.results__pages'),
  7.   recipe: () => document.querySelector('.recipe'),
  8.   recipeIngredientList: () => document.querySelector('.recipe__ingredient-list'),
  9.   recipeServings: () => document.querySelectorAll('.recipe__count')
  10. };
  11.  
  12. // Pa koristis:
  13. var sf = DOM_SELECTORS.searchForm();
  14.  
  15. --------------------------------------------------------
  16.  
  17. export const getDom = () => {
  18.   searchForm: document.querySelector('.search'),
  19.   searchInput: document.querySelector('.search__field'),
  20.   searchResults: document.querySelector('.results'),
  21.   searchResultsList: document.querySelector('.results__list'),
  22.   searchResultsPages: document.querySelector('.results__pages'),
  23.   recipe: document.querySelector('.recipe'),
  24.   recipeIngredientList: document.querySelector('.recipe__ingredient-list'),
  25.   recipeServings: document.querySelectorAll('.recipe__count')
  26. }
  27.  
  28. // Pa koristis:
  29. var DOM = getDom();
  30. var sf = DOM.searchForm;
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top