Ignore:
Timestamp:
03/10/14 17:10:16 (11 years ago)
Author:
hendrikvanantwerpen
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/model/widgets/TabbedQuestionBrowser.js

    r495 r501  
    1313        dndType: "question",
    1414        getCategories: function(){
    15             return categories.query();
     15            var opts = {};
     16            if ( this.include ) { opts[this.include] = true; }
     17            return categories.query(opts);
    1618        },
    1719        getCategoryName: function(category){ return category.name; },
    1820        getCategoryCount: function(category){ return category.count; },
    1921        getTopics: function(category) {
    20             return topics.query({category:category.name});
     22            var opts = {category:category.name};
     23            if ( this.include ) { opts[this.include] = true; }
     24            return topics.query(opts);
    2125        },
    2226        getTopicName: function(topic){ return topic.name; },
    2327        getTopicCount: function(topic){ return topic.count; },
    2428        getItems: function(category,topic) {
    25             return questions.query({category:category.name,topic:topic.name})
    26             .then(lang.hitch(this,function(items){
    27                 return array.filter(items, function(item){
    28                     return (this.include === 'published' && item.publicationDate) ||
    29                            (this.include === 'drafts' && !item.publicationDate) ||
    30                            true;
    31                 }, this);
    32             }));
     29            var opts = {category:category.name,topic:topic.name};
     30            if ( this.include ) { opts[this.include] = true; }
     31            return questions.query(opts);
    3332        },
    3433        getItemName: function(item) {
Note: See TracChangeset for help on using the changeset viewer.