Changeset 386


Ignore:
Timestamp:
07/29/12 16:04:45 (13 years ago)
Author:
hendrikvanantwerpen
Message:
  • Changed questions view to return null for empty topic/categorie and leave presentation of null to TabbedQuestionWidget?.
Location:
Dev/branches/rest-dojo-ui/client
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/config/docs.json

    r382 r386  
    6969            },
    7070            "questions": {
    71                 "map": "function(doc){ if ( doc.type === 'Question' ) { if ( doc.categories && doc.categories.length > 0 ) { for (var i = 0; i < doc.categories.length; i++) { emit([doc.categories[i],doc.topic || '[No topic]'],1); } } else { emit(['[No category]','[No topic]'],1); } } }",
     71                "map": "function(doc){ if ( doc.type === 'Question' ) { if ( doc.categories && doc.categories.length > 0 ) { for (var i = 0; i < doc.categories.length; i++) { emit([doc.categories[i],doc.topic || null],1); } } else { emit([null,null],1); } } }",
    7272                "reduce": "function(keys,values) { return sum(values); }"
    7373            },
  • Dev/branches/rest-dojo-ui/client/index.html

    r359 r386  
    1313    </head>
    1414    <body class="dijitReset claro">
    15         <div class="page" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
     15        <div class="page" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'center'" style="width: 100%; height: 100%;">
    1616            <div class="topbar" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
    1717                <a href="#!/index"><h1>ResearchTool</h1></a>
  • Dev/branches/rest-dojo-ui/client/rft/pages/survey.js

    r384 r386  
    6060                this.questionList = new QuestionListView({
    6161                    region: 'center'
    62                 }).placeAt(this.surveyListViewNode);
     62                },this.surveyListViewNode);
    6363                this.questionList.startup();
    6464            },
  • Dev/branches/rest-dojo-ui/client/rft/ui/TabbedQuestionBrowser.js

    r384 r386  
    2020            _busyCount: 0,
    2121            constructor: function(){
     22                this.inherited(arguments);
    2223                this._dataMap = {};
    2324            },
    2425            startup: function() {
     26                this.inherited(arguments);
    2527                this._busyWidget = new Standby({
    2628                    target: this.domNode,
     
    4042                    var categoryTab = new ContentPane({
    4143                        __category: category,
    42                         title: category+" ("+count+")"
     44                        title: (category || '[No category]')+" ("+count+")"
    4345                    });
    4446                    categoryTab.startup();
     
    6870                        __category: category,
    6971                        __topic: topic,
    70                         title: topic+" ("+count+")",
     72                        title: (topic || '[No topic]')+" ("+count+")",
    7173                        selectedActions: this.selectedActions,
    7274                        itemActions: this.itemActions
  • Dev/branches/rest-dojo-ui/client/rft/ui/_Page.js

    r367 r386  
    1 define(['dojo/_base/declare','dojo/_base/lang','dojo/parser','dojo/query',
    2     'dojo/dom-attr','dijit','dijit/_WidgetBase'],
    3     function(declare,lang,parser,query,attr,dijit,_WidgetBase){
    4         return declare('rft.ui._Page',[_WidgetBase],{
     1define([
     2    'dojo/_base/declare',
     3    'dojo/_base/lang',
     4    'dojo/dom-attr',
     5    'dojo/parser',
     6    'dojo/query',
     7    'dijit/layout/ContentPane',
     8    'dijit/registry'
     9    ],function(declare,lang,attr,parser,query,ContentPane,registry){
     10        return declare('rft.ui._Page',[ContentPane],{
    511            startup: function() {
    612                this.inherited(arguments);
     
    1117                query('*[data-rft-attach-point]'/*, this.domNode*/).forEach(lang.hitch(this,function(node){
    1218                    var point = attr.get(node,'data-rft-attach-point');
    13                     var widget = dijit.byId(attr.get(node,'id'));
     19                    var widget = registry.byId(attr.get(node,'id'));
    1420                    this[point] = widget || node;
    1521                }));
     
    1824                    var eventName = event[0];
    1925                    var eventHandler = event[1];
    20                     var widget = dijit.byId(attr.get(node,'id'));
     26                    var widget = registry.byId(attr.get(node,'id'));
    2127                    if ( widget ) {
    2228                        this.connect(widget,eventName,lang.hitch(this,eventHandler));
     
    3642            /** Event fired before leaving the page. Return false to prevent */
    3743            onLeave: function(){
    38                 dijit.findWidgets(this.domNode).forEach(function(w){
     44                registry.findWidgets(this.domNode).forEach(function(w){
    3945                    w.destroyRecursive(false);
    4046                });
Note: See TracChangeset for help on using the changeset viewer.