You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by garrensmith <gi...@git.apache.org> on 2014/08/21 13:19:50 UTC

[GitHub] couchdb-fauxton pull request: Api bar improvements

GitHub user garrensmith opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/37

    Api bar improvements

    If the api bar is visible and a user clicks elsewhere it closes.
    Also use correct icons

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/garrensmith/couchdb-fauxton api-bar-improvements

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/37.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #37
    
----
commit b3cf2e69a1349e07cd02716f6ac5e5fe68a3091c
Author: Garren Smith <ga...@gmail.com>
Date:   2014-08-21T11:18:22Z

    Api bar improvements
    
    If the api bar is visible and a user clicks elsewhere it closes.
    Also use correct icons

----


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53394622
  
    @robertkowalski those cannot be removed as we need methods to hide the api button on pages that don't have a relevant api url.
    
    I've also done your code clean up on the `hideAPIbar`. Can I merge this in?


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53443330
  
    awesome, thanks! +1


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53448349
  
    Merged in. Thanks @robertkowalski and @seanbarclay for the help on 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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53326249
  
    I found https://github.com/garrensmith/couchdb-fauxton/blob/api-bar-improvements/app/addons/fauxton/base.js#L318-L323 -  can they get removed now as we have `hideAPIbar` et al?


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith closed the pull request at:

    https://github.com/apache/couchdb-fauxton/pull/37


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53195145
  
    works like charm 4me on Chrome, FF, (even) IE ;-)


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53240570
  
    Awesome thanks @robertkowalski I didn't know about `:visible` I will make the change. Thanks for testing @sebastianrothbucher.


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#discussion_r16678740
  
    --- Diff: app/addons/fauxton/base.js ---
    @@ -268,15 +270,42 @@ function(app, FauxtonAPI, resizeColumns, Components, ZeroClipboard) {
         events:  {
           "click .api-url-btn" : "toggleAPIbar"
         },
    +    
    +    initialize: function () {
    +      var hideAPIbar = _.bind(this.hideAPIbar, this),
    +          navbarVisible = _.bind(this.navbarVisible, this);
    +
    +
    +      $('body').on('click.apibar',function(e) {
    +        var $navbar = $(e.target);
    +        if (!navbarVisible()) { return;}
    +        if ($navbar.hasClass('.api-url-btn')) { return;}
    +
    +        if (!$navbar.closest('.api-navbar').length){
    +          hideAPIbar();
    +        }
    +      });
    +    },
     
    -    toggleAPIbar: function(e){
    -      var $currentTarget = $(e.currentTarget).find('span');
    -      if ($currentTarget.hasClass("fonticon-plus")){
    -        $currentTarget.removeClass("fonticon-plus").addClass("fonticon-minus");
    -      }else{
    -        $currentTarget.removeClass("fonticon-minus").addClass("fonticon-plus");
    +    navbarVisible: function () {
    +      return this.$('.api-navbar').is(':visible');
    +    },
    +
    +    cleanup: function () {
    +      $('body').off('click.apibar');
    +    },
    +
    +    hideAPIbar: function () {
    +      this.$('.api-navbar').velocity("reverse", 250);
    +      this.$('.api-navbar').hide();
    --- End diff --
    
    If you add the hide in the callback, you can see the animation. The hide is then called after the animation finished.
    
    ```javascript
        hideAPIbar: function () {
          var $navBar = this.$('.api-navbar');
          $navBar.velocity("reverse", 250, function () {
            $navBar.hide();
          });
        },
    ```


---
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.
---

[GitHub] couchdb-fauxton pull request: Api bar improvements

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/37#issuecomment-53243585
  
    @robertkowalski, @sebastianrothbucher I've merged in @seanbarclay improvements. And done some code improvements.


---
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.
---