assets/js/main.js
/**
 * Create popup element that we need on right click
 *
 * @param {Object} options array of object used to build our HTML element.
 * @param {String} cls custom className which is added to uniquely identify popup.
 */
Create popup element that we need on right click
@param {Object} options array of object used to build our HTML element.
@param {String} cls custom className which is added to uniquely identify popup.
Create popup element that we need on right click @param { Object } options array of object used to build our HTML element . @param { String } cls custom className which is added to uniquely identify popup .
function createPopup(options, cls) {
  const fragment = document.createDocumentFragment();
  const listParent = document.createElement("ul");
  setAttributes(listParent, { class: "popup " + cls });
  for (let i = 0; i < options.length; i++) {
    const list = document.createElement("li");
    setAttributes(list, { class: options[i].key });
    list.textContent = options[i].value;
    fragment.appendChild(list);
  }
  listParent.appendChild(fragment);
  app.appendChild(listParent);
}
function createPopup ( options , cls ) { const fragment = document . createDocumentFragment ( ) ; const listParent = document . createElement ( "ul" ) ; setAttributes ( listParent , { class : "popup " + cls } ) ; for ( let i = 0 ; i < options . length ; i ++ ) { const list = document . createElement ( "li" ) ; setAttributes ( list , { class : options [ i ] . key } ) ; list . textContent = options [ i ] . value ; fragment . appendChild ( list ) ; } listParent . appendChild ( fragment ) ; app . appendChild ( listParent ) ; }
Create popup element that we need on right click
 @param {Object} options array of object used to build our HTML element.
Create popup element that we need on right click @param { Object } options array of object used to build our HTML element .