Github user benkeen commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/152#discussion_r20371316
  
    --- Diff: app/addons/fauxton/components.js ---
    @@ -762,6 +762,15 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
               return 'Your changes have not been saved. Click cancel to return 
to the document.';
             }
           });
    +
    +      $(window).resize(_.debounce( function () {
    +        that.editor.resize(true);
    +      }, 500));
    +
    +      this.listenTo(FauxtonAPI.Events, 'burger:click', function () {
    +        that.editor.resize(true);
    +      });
    --- End diff --
    
    Maybe avoid the duplicate code and stick the shared function in a var for 
re-use.
    ```javascript
    var onResize = _.debounce(function () { that.editor.resize(true); }, 500);
    $(window).resize(onResize);
    $(window).click(onResize);
    ```
    
    Tempting to stick 500 in constants.js, too.... but meh, that's probably 
overkill.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to