main.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. let ringo_save_data = '';
  2. let ringo_open = 0;
  3. let ringo_menu_list = [
  4. 'recent_cel',
  5. 'other_cel',
  6. 'user_cel',
  7. 'add_cel'
  8. ];
  9. function ringo_opening(data) {
  10. let element = [data];
  11. for(for_a in ringo_menu_list) {
  12. if(ringo_menu_list[for_a] + '_in' !== data) {
  13. element.push(ringo_menu_list[for_a] + '_in');
  14. }
  15. }
  16. if((document.getElementById(element[0]).style.display == 'none' && ringo_open == 0) || ringo_save_data !== data) {
  17. document.getElementById(element[0]).style.display = 'block';
  18. for(for_a in element) {
  19. if(for_a !== '0') {
  20. document.getElementById(element[for_a]).style.display = 'none';
  21. }
  22. }
  23. ringo_open = 1;
  24. ringo_save_data = data;
  25. setTimeout(function() { ringo_open = 2; }, 100);
  26. } else {
  27. document.getElementById(element[0]).style.display = 'none';
  28. ringo_open = 0
  29. }
  30. }
  31. document.onclick = function(event) {
  32. let cel_list = [];
  33. for(for_a in ringo_menu_list) {
  34. cel_list.push(document.getElementById(ringo_menu_list[for_a]));
  35. }
  36. if(ringo_save_data !== '' && ringo_open == 2) {
  37. document.getElementById(ringo_save_data).style.display = 'none';
  38. setTimeout(function() { ringo_open = 0; }, 100);
  39. }
  40. }