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 Option tray now uses generic com...
Date Thu, 13 Nov 2014 10:48:34 GMT
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/145#discussion_r20283214
  
    --- Diff: app/addons/config/views.js ---
    @@ -149,31 +149,15 @@ function(app, FauxtonAPI, Config, Components) {
       });
     
     
    -  Views.AddConfigOptionsButton = FauxtonAPI.View.extend({
    +  Views.AddConfigOptionsButton = Components.Tray.extend({
         template: 'addons/config/templates/add_config_option',
     
         events: {
    -      'click #add-new-section': 'toggleTray',
           'click #js-create-config-section': 'createConfigOption'
         },
     
         initialize: function () {
    -      var hideTray = _.bind(this.hideTray, this),
    -        trayVisible = _.bind(this.trayVisible, this);
    -
    -      $('body').on('click.add-new-section', function(e) {
    -        var $clickEl = $(e.target);
    -
    -        if (!trayVisible()) { return; }
    -        if ($clickEl.closest('.add-new-section').length) { return; }
    -        if (!$clickEl.closest('.add-section-tray').length) {
    -          hideTray();
    -        }
    -      });
    -    },
    -
    -    cleanup: function () {
    -      $('body').off('click.add-new-section');
    +      this.initTray({ toggleTrayBtnSelector: '#add-new-section' });
    --- End diff --
    
    still not a big fan of calling a custom-built constructor instead of just passing the
options to the extend, like in every other backbone application. main reason is that it is
a custom-workaround where there is already a solution provided by the framework and every
backbone-dev which is coming from another application has to learn that we build our own custom
constructors/initialize


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