couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowalski <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Add auto focus to Delete DB modal
Date Mon, 15 Dec 2014 11:30:04 GMT
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/203#discussion_r21818331
  
    --- Diff: app/addons/fauxton/components.js ---
    @@ -553,6 +553,12 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
           _.bindAll(this);
         },
     
    +    afterRender: function () {
    +      this.$('.modal').on('shown', function () {
    +        $('input:text:visible:first', this).focus();
    --- End diff --
    
    We usually use `this.$` and no `$(selector)` - I assume you use a global selector as you
were the context of this was wrong?
    
    ```javascript
          this.$('.modal').on('shown', function () {
            this.$('input').focus();
          }.bind(this));
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message