# כיצד למחוק את סרגל הכלים התחתון אך לא על ידי display none?

**URL:** https://meta.discourse.org/t/how-to-delete-the-toolbar-bottom-but-not-by-display-none/233723
**Category:** Development
**Created:** [23 ביולי,‏ 2022,‏ 6:46am UTC](https://meta.discourse.org/t/how-to-delete-the-toolbar-bottom-but-not-by-display-none/233723 "2022-07-23T06:46:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![FenLanPHE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fenlanphe/32/265472_2.png) [@FenLanPHE](https://meta.discourse.org/u/FenLanPHE)
#### Post date: [23 ביולי,‏ 2022,‏ 6:46am UTC](https://meta.discourse.org/t/how-to-delete-the-toolbar-bottom-but-not-by-display-none/233723/1 "2022-07-23T06:46:05Z")

</div>

I have added some custom buttons as shown below, but I want to know how to delete the buttons already added in TOOLBAR CLASS? 🤔  
 ![image](https://global.discourse-cdn.com/meta/original/4X/6/6/d/66d70321a0c12e86a455fe8573554394165942d4.png)  
Also, my custom button function is a snippet of code for me to quickly add dice, I would like to know how to give this button the ability to make the text already added disappear when clicked again like the bold button?

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/c/d/acd54735b17f1a58c54726120571f2e2e2f7a60e.png)  
I’ve searched up many topics but still can’t find a solution  
**Thanks for your reples!**

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [23 ביולי,‏ 2022,‏ 9:04am UTC](https://meta.discourse.org/t/how-to-delete-the-toolbar-bottom-but-not-by-display-none/233723/2 "2022-07-23T09:04:42Z")

</div>

Using CSS to hide the toolbar button may be enough.

[https://github.com/discourse/discourse/commit/e303b4d1818422863ac8cc17b34dd65186f50989](https://github.com/discourse/discourse/commit/e303b4d1818422863ac8cc17b34dd65186f50989)

And the `bold` function implemented by the `applySurround` method.

> <https://github.com/discourse/discourse/blob/c94a011d9fe334f82e41900b871ca13dff38897d/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js#L209>

---

<div class="post-metadata">

### Author: ![FenLanPHE](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fenlanphe/32/265472_2.png) [@FenLanPHE](https://meta.discourse.org/u/FenLanPHE)
#### Post date: [23 ביולי,‏ 2022,‏ 6:04pm UTC](https://meta.discourse.org/t/how-to-delete-the-toolbar-bottom-but-not-by-display-none/233723/3 "2022-07-23T18:04:32Z")

</div>

Thanks for your reply! But I noticed that when I click the BOLD button, the code \*\* appears and then disappears when I click it again. My custom button does not have the ability to disappear the code when clicked again.

Do you have any solution for this? The code for my custom button is as follows:

```plaintext
<script type="text/discourse-plugin" version="0.8">
  const currentLocale = I18n.currentLocale();
  if (!I18n.translations[currentLocale].js.composer) {
    I18n.translations[currentLocale].js.composer = {};
  }
  I18n.translations[currentLocale].js.composer.ttl_spoiler_text = "Insert hidden content";
  I18n.translations[currentLocale].js.ttl_dice_title = "ttl-spoiler";
  api.onToolbarCreate(function(toolbar) {
    toolbar.addButton({
      id: "ttl-spoiler",
      icon: "ttl-spoiler-icon",
      group: "extras",
      preventFocus: true,
      trimLeading: true,
      perform: (e) => e.applySurround("[spoiler]", "[/spoiler]", "ttl_spoiler_text")
    });
  });
</script>

```

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [24 ביולי,‏ 2022,‏ 6:30am UTC](https://meta.discourse.org/t/how-to-delete-the-toolbar-bottom-but-not-by-display-none/233723/4 "2022-07-24T06:30:28Z")

</div>

Give a try the `opts` argument.

> <https://github.com/discourse/discourse-spoiler-alert/blob/a1e4d543e1bafeb11cbb9d09a887ce210b7eecb8/assets/javascripts/initializers/spoiler-alert.js#L35>
