Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = function(){
  2.   // small dialog
  3.  
  4.   // get the modal by its id
  5.   var modal = document.getElementsByClassName("RemoveManufacturerModalContainer");
  6.  
  7.   // get the button what opens the modal by its id
  8.   //var openModal = document.getElementsByClassName("open-me");
  9.  
  10.   // get the bunnton what closes the modal
  11.   var close = document.getElementById('close-me');
  12.  
  13.   // get the close button
  14.   var closeBtn = document.getElementById('closebtn');
  15.  
  16.   // when the user clicks on delete open the modal
  17.   setTimeout(function() {
  18.   var element = document.getElementsByClassName('open-me')[0];
  19.   element.addEventListener("click", function(e) {
  20.   alert('something');
  21.   }, false);
  22.   }, 500);
  23.   // when the user clickson the x in the modal header
  24.   close.onclick = function(){
  25.     modal.style.display = "none";
  26.   };
  27.  
  28.   // when the user clicks on the footer xlose button
  29.   closeBtn.onclick = function(){
  30.     modal.style.display = "none";
  31.   };
  32.   // if the user clicks anywere out of the modal close it
  33.   window.onclick = function(event){
  34.     if (event.target === modal){
  35.         modal.style.display = "none";
  36.     }
  37.   };
  38. };
  39.     // /. window onload
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement