# É possível fazer o botão "Sign Up" persistir durante a rolagem, em vez do "Log In"?

**URL:** <https://meta.discourse.org/t/is-it-possible-to-have-the-sign-up-button-persist-during-scroll-rather-than-the-log-in-one/118116>\
**Category:** Product Support\
**Created:** [18 Maio , 2019 21:51 UTC](https://meta.discourse.org/t/is-it-possible-to-have-the-sign-up-button-persist-during-scroll-rather-than-the-log-in-one/118116 "2019-05-18T21:51:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**Post date:** [20 Maio , 2019 19:06 UTC](https://meta.discourse.org/t/is-it-possible-to-have-the-sign-up-button-persist-during-scroll-rather-than-the-log-in-one/118116/3 "2019-05-20T19:06:15Z")

</div>

It is possible, here’s one way to do it.

You’re essentially replacing our [default header-buttons widget](https://github.com/discourse/discourse/blob/446ec1b44a6299be4e97ca8524001e8787f98594/app/assets/javascripts/discourse/widgets/header.js.es6) and moving `!attrs.topic`. You can add this to a theme in the `header` section (admin \> customize \> themes \> edit CSS/HTML).

```js
<script type="text/discourse-plugin" version="0.8.13">
api.reopenWidget("header-buttons", {
      tagName: "span.header-buttons",

  html(attrs) {
    if (this.currentUser) {
      return;
    }

    const buttons = [];

    if (attrs.canSignUp) {
      buttons.push(
        this.attach("button", {
          label: "sign_up",
          className: "btn-primary btn-small sign-up-button",
          action: "showCreateAccount"
        })
      );
    }

    if (!attrs.topic) {
    buttons.push(
      this.attach("button", {
        label: "log_in",
        className: "btn-primary btn-small login-button",
        action: "showLogin",
        icon: "user"
      })
    );
    }
    
    return buttons;
  }
});
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/is-it-possible-to-have-the-sign-up-button-persist-during-scroll-rather-than-the-log-in-one/118116)._
