# Reuse Discourse Hamburger Functionality

**URL:** <https://meta.discourse.org/t/reuse-discourse-hamburger-functionality/85578>\
**Category:** Product Support\
**Created:** [17.Апрель.2018 21:42:12 UTC](https://meta.discourse.org/t/reuse-discourse-hamburger-functionality/85578 "2018-04-17T21:42:12Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![spirobel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spirobel/32/170908_2.png) [@spirobel](https://meta.discourse.org/u/spirobel)\
**Post date:** [02.Июль.2020 14:32:46 UTC](https://meta.discourse.org/t/reuse-discourse-hamburger-functionality/85578/11 "2020-07-02T14:32:46Z")

</div>

Ха-ха, по совпадению я тоже смотрю на ровно ту же вещь. Думаю, лучший способ — переоткрыть виджет «гамбургер-меню» и переопределить метод html.

> <https://github.com/discourse/discourse/blob/c200238bdc241586bfe82b2d0fc1f600fec45b1f/app/assets/javascripts/discourse/app/widgets/hamburger-menu.js#L328>

Я добавлю свой виджет в начало списка перед элементом faq. Я не проверял, работает ли это, но это будет мой подход 😃  
Здесь, кажется, это работает:

```javascript
  api.reopenWidget("hamburger-menu", {

      html() {
        let conti = this.panelContents()
        conti.unshift(h('div',[h('span','blabla описание: '),this.attach('widget-dropdown',
  {id: "from", translatedLabel: "bla",onChange: "changeaction",
  content: [
      { id: 1, label: "foo.bar" },
      { id: 2, translatedLabel: "FooBar" },
      { id: 3, label: "foo.baz", icon: "times" },
      { id: 4, html: "<b>foo</b>" },
    ],
    options: {bodyClass: "lang-drop-body"}
  })]))
        return this.attach("menu-panel", {
          contents: () => conti,
          maxWidth: this.settings.maxWidth
        });
      },
  });

```

Я, например, добавил выпадающий список.  
Ура!

---

_[View the full topic](https://meta.discourse.org/t/reuse-discourse-hamburger-functionality/85578)._
