couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Secondary indexes: huge branch
Date Tue, 19 Aug 2014 11:30:02 GMT
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/33#discussion_r16408673
  
    --- Diff: app/addons/indexes/views.js ---
    @@ -34,8 +34,241 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     
       var Views = {};
     
    +
    +//right header
    +  Views.RightHeader = FauxtonAPI.View.extend({
    +    className: "header-right",
    +    template: "addons/indexes/templates/header_right",
    +    initialize:function(options){
    +      _.bindAll(this);
    +      this.database = options.database;
    +      this.title = options.title;
    +      this.api = options.api;
    +      this.endpoint = options.endpoint;
    +      this.documentation = options.documentation;
    +      this.eventer = _.extend({}, Backbone.Events);
    +      FauxtonAPI.Events.on('advancedOptions:updateView', this.updateView);
    +    },
    +    updateApiUrl: function(api){
    +      //this will update the api bar when the route changes
    +      //you can find the method that updates it in components.js Components.ApiBar()
    +      this.apiBar && this.apiBar.update(api);
    +    },
    +    beforeRender: function(){
    +
    +      this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({
    +        endpoint: this.endpoint,
    +        documentation: this.documentation
    +      }));
    +
    +      this.advancedOptions = this.insertView('#query-options', new QueryOptions.AdvancedOptions({
    +        database: this.database,
    +        viewName: this.viewName,
    +        ddocName: this.model.id,
    +        hasReduce: this.hasReduce(),
    +        eventer: this.eventer,
    +        showStale: true
    +      }));
    +    },
    +    hasReduce: function(){
    +
    +    },
    +    updateView: function(event, paramInfo) {
    +       event.preventDefault();
    +
    +       var errorParams = paramInfo.errorParams,
    +           params = paramInfo.params;
    +
    +       if (_.any(errorParams)) {
    +         _.map(errorParams, function(param) {
    +
    +           // TODO: Where to add this error?
    +           // bootstrap wants the error on a control-group div, but we're not using that
    +           //$('form.view-query-update input[name='+param+'], form.view-query-update
select[name='+param+']').addClass('error');
    --- End diff --
    
    Is this still relevant?


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