Ignore:
Timestamp:
03/10/14 00:47:38 (11 years ago)
Author:
hendrikvanantwerpen
Message:
File:
1 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){
Note: See TracChangeset for help on using the changeset viewer.