Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
  3. *
  4. * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
  5. *
  6. * @license GNU AGPL version 3 or any later version
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as
  10. * published by the Free Software Foundation, either version 3 of the
  11. * License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. import OC from '../OC'
  22. import $ from 'jquery'
  23. export const setUp = () => {
  24. const $menu = $('#header #settings')
  25. // show loading feedback
  26. $menu.delegate('a', 'click', event => {
  27. let $page = $(event.target)
  28. if (!$page.is('a')) {
  29. $page = $page.closest('a')
  30. }
  31. if (event.which === 1 && !event.ctrlKey && !event.metaKey) {
  32. $page.find('img').remove()
  33. $page.find('div').remove() // prevent odd double-clicks
  34. $page.prepend($('<div/>').addClass('icon-loading-small'))
  35. } else {
  36. // Close navigation when opening menu entry in
  37. // a new tab
  38. OC.hideMenus(() => false)
  39. }
  40. })
  41. $menu.delegate('a', 'mouseup', event => {
  42. if (event.which === 2) {
  43. // Close navigation when opening app in
  44. // a new tab via middle click
  45. OC.hideMenus(() => false)
  46. }
  47. })
  48. }