daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest May 17th, 2018 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function hideDetails(table) {
  2.     let promise = new Promise((resolve, reject)=> {
  3.         if ( countSelected(table) == "multiple" || countSelected(table) == "none") {
  4.             document.getElementById( 'details' ).style.display = 'none';
  5.             document.getElementById( 'configDetailsWrap' ).style.display = 'none';
  6.             document.getElementById( 'list' ).style.display = 'none';
  7.             document.getElementById( 'list_2' ).style.display = 'none';
  8.             resolve();
  9.         }
  10.         else {
  11.             document.getElementById( 'details' ).style.display = 'block';
  12.             resolve();
  13.         }
  14.     })
  15.     return promise;
  16. }
  17.    
  18. hideDetails(table).then(function() {
  19.                 let item = $('#details');
  20.                 let position = item.position();
  21.                 window.scrollTo(0, position.top);
  22.             },
  23.             function() {
  24.                 console.log('Error while displaying details.')
  25.             });
RAW Paste Data
Top