main.js 1.3 KB

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