Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. var stack = [];
  2. var lastState = document.getElementById('drop_zone_content').innerHTML;
  3. stack.push(lastState);
  4. var observer = new MutationObserver(function(div) {
  5.  
  6. if(current_hash != old_hash){
  7.  
  8. var newState = document.getElementById('drop_zone_content').innerHTML;
  9. stack.push(newState);
  10. old_hash = current_hash;
  11.  
  12. }
  13. });
  14.  
  15. function undo(){
  16. document.getElementById('drop_zone_content').innerHTML = stack.pop();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement