couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-2215) Update Primary Nav bar to match new docs
Date Mon, 31 Mar 2014 20:39:16 GMT


ASF GitHub Bot commented on COUCHDB-2215:

Github user deathbearbrown commented on a diff in the pull request:
    --- Diff: src/fauxton/app/addons/fauxton/base.js ---
    @@ -202,21 +202,17 @@ function(app, FauxtonAPI, resizeColumns) {
         afterRender: function(){
           $('#primary-navbar li[data-nav-name="' + app.selectedHeader + '"]').addClass('active');
    -      var menuOpen = true;
           var $selectorList = $('body');
    -      $('.brand').off();
    -      $('.brand').on({
    +      this.$('.burger').off();
    +      this.$('.burger').on({
             click: function(e){
    -          if(!$('a')){
    -          }
    -        }
    +         }
           function toggleMenu(){
    -        menuOpen = $selectorList.hasClass('closeMenu');
    -        this.resizeColumns.onResizeHandler();
    +        app.windowResize.onResizeHandler();
    --- End diff --
    app doesn't exist in this context. I think you mean this.resize because this.resize is
defined in the initialize function.
    the reason this.resizeColumns.onResizeHandler(); wouldn't work inside this toggle menu
function is that it's context is outside the function. 
    toggleMenu's context (this) doesn't have a variable called resizeColumns.
    If you move toggleMenu out into the view's object, then it will have access to this.resizeColumns
because it shares a context with it.
    But in future, if you ever come across this kinda thing,  you can always pass a context
into a JS function using .call() or .apply()  or if you don't want to execute the function
yet, you can use underscore's _.bind() method. 
    An example so you know what I mean:
    var  foo = { 
           name: "sue"
    function sayName(greeting){
        return greeting+" ";

> Update Primary Nav bar to match new docs
> ----------------------------------------
>                 Key: COUCHDB-2215
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>      Security Level: public(Regular issues) 
>            Reporter: Sue Lockwood
> Update the animation.  Add the burger to the top, Logo at the bottom, don't seperate
the 2 menus. 

This message was sent by Atlassian JIRA

View raw message