Extract Backbone Lightbox view module
							parent
							
								
									8cfe12644a
								
							
						
					
					
						commit
						593976fe21
					
				@ -1,3 +1,7 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @prettier
 | 
			
		||||
 */
 | 
			
		||||
import * as Conversation from './Conversation';
 | 
			
		||||
import * as Views from './views';
 | 
			
		||||
 | 
			
		||||
export { Conversation };
 | 
			
		||||
export { Conversation, Views };
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,25 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @prettier
 | 
			
		||||
 */
 | 
			
		||||
export const show = (element: HTMLElement): void => {
 | 
			
		||||
  const container: HTMLDivElement | null = document.querySelector(
 | 
			
		||||
    '.lightboxContainer'
 | 
			
		||||
  );
 | 
			
		||||
  if (container === null) {
 | 
			
		||||
    throw new TypeError("'.lightboxContainer' is required");
 | 
			
		||||
  }
 | 
			
		||||
  container.innerHTML = '';
 | 
			
		||||
  container.style.display = 'block';
 | 
			
		||||
  container.appendChild(element);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const hide = (): void => {
 | 
			
		||||
  const container: HTMLDivElement | null = document.querySelector(
 | 
			
		||||
    '.lightboxContainer'
 | 
			
		||||
  );
 | 
			
		||||
  if (container === null) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  container.innerHTML = '';
 | 
			
		||||
  container.style.display = 'none';
 | 
			
		||||
};
 | 
			
		||||
@ -0,0 +1,6 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @prettier
 | 
			
		||||
 */
 | 
			
		||||
import * as Lightbox from './Lightbox';
 | 
			
		||||
 | 
			
		||||
export { Lightbox };
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue