Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ExtendedToolbarToggler.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* global $ */
  2. const ExtendedToolbarToggler = {
  3. init() {
  4. document.getElementById("extendedToolbarPanel")
  5. .addEventListener("animationend", function(e) {
  6. console.log("ANIM NAME", e.animationName);
  7. if(e.animationName === "slideOutExt")
  8. $("#extendedToolbarPanel").children().each(function() {
  9. if ($(this).hasClass("show"))
  10. $(this).removeClass("show").addClass("hide");
  11. });
  12. }, false);
  13. },
  14. toggle(elementId) {
  15. let elementSelector = $(`#${elementId}`);
  16. let isSelectorVisible = elementSelector.hasClass("show");
  17. if (isSelectorVisible) {
  18. this.hide();
  19. }
  20. else {
  21. if (this.isVisible())
  22. $("#extendedToolbarPanel").children().each(function() {
  23. if ($(this).id !== elementId && $(this).hasClass("show"))
  24. $(this).removeClass("show").addClass("hide");
  25. });
  26. if (!this.isVisible())
  27. this.show();
  28. elementSelector.removeClass("hide").addClass("show");
  29. }
  30. },
  31. /**
  32. * Returns true if this toolbar is currently visible, or false otherwise.
  33. * @return <tt>true</tt> if currently visible, <tt>false</tt> - otherwise
  34. */
  35. isVisible() {
  36. return $("#extendedToolbarPanel").hasClass("slideInExt");
  37. },
  38. /**
  39. * Hides the toolbar with animation or not depending on the animate
  40. * parameter.
  41. */
  42. hide(elementId) {
  43. $("#extendedToolbarPanel")
  44. .removeClass("slideInExt").addClass("slideOutExt");
  45. },
  46. /**
  47. * Shows the toolbar with animation or not depending on the animate
  48. * parameter.
  49. */
  50. show(elementId) {
  51. if (!this.isVisible())
  52. $("#extendedToolbarPanel")
  53. .removeClass("slideOutExt").addClass("slideInExt");
  54. },
  55. resize () {
  56. //let [width, height] = UIUtil.getSidePanelSize();
  57. //Chat.resizeChat(width, height);
  58. }
  59. };
  60. export default ExtendedToolbarToggler;