Ignore:
Timestamp:
03/23/14 22:58:54 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Added grey icons for better highlighting, synced block and large buttons.
  • Introduced extra color for text, now disabled/inactive/hovered -> it's not very clear though.
  • Added confirmation on irrevertable actions.
  • Added support for query string in our new request implementation.
File:
1 edited

Legend:

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

    r519 r529  
    4747            .then(lang.hitch(this,function(allResponses){
    4848                array.forEach(allResponses, function(response){
    49                     var actions = {};
     49                    var actions = {}, w;
    5050                    if ( !response.publicationDate ) {
    5151                        actions.Delete = {
    52                             callback: function(){
    53                                 responses.remove(response)
    54                                 .then(function(){
    55                                     w.destroy();
    56                                 });
    57                             },
     52                            callback: lang.hitch(this,function(){
     53                                // We cannot bind _onDeleteResponse
     54                                // directly, because of the
     55                                // initialization problem with w. We
     56                                // need it in the handler, but we need
     57                                // to pass the handler as an argument
     58                                // on the creation of w.
     59                                this._onDeleteResponse(response,w);
     60                            }),
    5861                            properties: {
    5962                                icon: 'Delete',
     
    6265                        };
    6366                    }
    64                     var w = new LineWithActionsWidget({
     67                    w = new LineWithActionsWidget({
    6568                        actions: actions
    6669                    });
     
    7073                }, this);
    7174            }));
     75        },
     76        _onDeleteResponse: function(response,w) {
     77            if ( !confirm("Are you sure you want to delete this survey response?") ) {
     78                return;
     79            }
     80            responses.remove(response)
     81            .then(function(){
     82                w.destroy();
     83            });
    7284        },
    7385        _handlePropChange: function(e) {
Note: See TracChangeset for help on using the changeset viewer.