Ignore:
Timestamp:
03/10/14 00:47:38 (11 years ago)
Author:
hendrikvanantwerpen
Message:
Location:
Dev/trunk/src/client/qed-client/pages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/questions.js

    r490 r495  
    1919                'class': 'orange',
    2020                dndType: null,
    21                 itemActions: {
    22                     Delete: {
    23                         callback: lang.hitch(this,"onDeleteQuestion"),
    24                         icon: 'Delete',
    25                         description: 'Delete question'
    26                     },
    27                     Edit: {
    28                         callback: lang.hitch(this,"onEditQuestion"),
    29                         icon: 'Edit',
    30                         description: 'Edit question'
    31                     },
    32                     Publish: {
    33                         callback: lang.hitch(this,"onPublishQuestion"),
    34                         icon: 'Publish',
    35                         description: 'Publish question'
     21                getItemActions: lang.hitch(this,function(item) {
     22                    var actions = {
     23                        Edit: {
     24                            callback: lang.hitch(this,"onEditQuestion"),
     25                            icon: 'Edit',
     26                            description: 'Edit question'
     27                        }
     28                    };
     29                    if ( !item.publicationDate ) {
     30                        lang.mixin(actions,{
     31                            Delete: {
     32                                callback: lang.hitch(this,"onDeleteQuestion"),
     33                                icon: 'Delete',
     34                                description: 'Delete question'
     35                            },
     36                            Publish: {
     37                                callback: lang.hitch(this,"onPublishQuestion"),
     38                                icon: 'Publish',
     39                                description: 'Publish question'
     40                            }
     41                        });
    3642                    }
    37                 }
     43                    return actions;
     44                })
    3845            },this.questionBrowser);
    3946            this.questionBrowser.startup();
     
    4552            questions.remove(question)
    4653            .then(lang.hitch(this,function(){
     54                this.questionBrowser.removeItem(question);
    4755                this.notify("Question deleted.");
    4856            }),lang.hitch(this,function(err){
  • Dev/trunk/src/client/qed-client/pages/survey.js

    r494 r495  
    3131                'class': 'blue',
    3232                include: 'published',
    33                 selectedActions: {
    34                     "Include": {
    35                         callback: lang.hitch(this,this._includeQuestion),
    36                         icon: "Accept",
    37                         description: "Include in survey"
    38                     }
    39                 },
    40                 itemActions: {
    41                     "Info": {
    42                         callback: function(item){
    43                             if ( item.description ) { alert(item.description); }
    44                         },
    45                         icon: "Inspect",
    46                         description: "Show item description"
    47                     }
    48                 }
     33                getSelectedItemActions: lang.hitch(this,function() {
     34                    return {
     35                        "Include": {
     36                            callback: lang.hitch(this,this._includeQuestion),
     37                            icon: "Accept",
     38                            description: "Include in survey"
     39                        }
     40                    };
     41                }),
     42                getItemActions: lang.hitch(this,function(item) {
     43                    return {
     44                        "Info": {
     45                            callback: lang.hitch(this,function(item){
     46                                if ( item.description ) { alert(item.description); }
     47                            }),
     48                            icon: "Inspect",
     49                            description: "Show item description"
     50                        }
     51                    };
     52                })
    4953            },this.questionBrowser);
    5054            this.questionBrowser.startup();
Note: See TracChangeset for help on using the changeset viewer.