Ignore:
Timestamp:
05/30/12 16:39:27 (13 years ago)
Author:
tjcschipper
Message:
  • Removed rft/ui/*Button classes, since they are not actually needed. All buttons use standard dijit.form.Button again.

(baseClass: 'rft*Button', color: 'lowercase *, iconClass: 'rftIcon rftIcon*')

  • Changed CSS color classes to be shorter and more organized. No more highlightRed, now just red.
  • Moved extra .css files from client/dojotoolkit/dijit/themes/gamelab folder to client/rft/css folder, so they are actually included. Same for icons. Gamelab theme now contains only original Claro theme with renamed base class. Part of an effort to make the gamelab style work with standard inclusions of Dojo toolkit. (Override instead of change!)
  • Changed rft/ui/LineWithActionsWidgetThijs.js to use the new Button format.
  • Changed rft/ui/LineWithActionsWidgetThijs.js and rft/ui/SelectorThijs.js to use a new way to add Actions to the LineWithActions?. Instead of {"action": function(){}}, you now pass {"action": {callback: function(){}, properties: {props}}}.

The properties object is used as a mixin during creation of the Buttons, so you can directly set properties on the resulting buttons here. Most important one: action.properties.blockButton (boolean), that determines whether the Button should be a blockButton or inlineButton.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/ui/SelectorThijs.js

    r333 r335  
    88    'dijit/_Container',
    99    './LineWithActionsWidgetThijs',
    10     'dojo/text!./templates/Selector.html',
     10    'dojo/text!./templates/SelectorThijs.html',
    1111    'dojo/dom-class'
    1212    ],function(
     
    2626            title: "The professional as a participant",
    2727            baseClass: 'rftSelector',
     28            color: 'red',    // This is hardcoded for now, will serve as default value later! (Selector defaults to blue!) Only affects color of lineWithActions
    2829            postCreate: function() {
    2930                var infoFunction = function() {
     
    3233                new LineWithActionsWidget({
    3334                    title: this.title,
     35                    color: this.color,
    3436                    actions: {
    35                         "Accept" : function(){}
     37                        "Accept" : {
     38                            callback: function(arg){},
     39                            properties: {
     40                                blockButton: true,
     41                                color: this.color
     42                            }
     43                        }
    3644                    }
    3745                },this.titleNode);
    3846                var selectorLine = new LineWithActionsWidget({
    3947                    title: 'None',
     48                    color: this.color,
    4049                    actions: {
    41                         "HalfArrowDown" : lang.hitch(this,function(){
    42                             var node = this.optionsNode;
    43                             var show = fx.wipeIn({
    44                                 node: node
    45                             });
    46                             var hide = fx.wipeOut({
    47                                 node: node
    48                             });
    49                             hide.play();
    50                             var folded = true;
    51                             return function(e) {
    52                                 if ( folded ) {
    53                                     // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode
    54                                     var downArrowIcon = dojo.query(".rftInlineButton .rftIconHalfArrowDown", selectorLine.buttonsNode)[0];  // Query the down arrow rftIcon span
    55                                     if (downArrowIcon){
    56                                         domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
     50                        "HalfArrowDown" : {
     51                            callback: lang.hitch(this,function(){
     52                                var node = this.optionsNode;
     53                                var show = fx.wipeIn({
     54                                    node: node
     55                                });
     56                                var hide = fx.wipeOut({
     57                                    node: node
     58                                });
     59                                hide.play();
     60                                var folded = true;
     61                                return function(e) {
     62                                    if ( folded ) {
     63                                        // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode
     64                                        var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", selectorLine.buttonsNode)[0];  // Query the down arrow rftIcon span
     65                                        if (downArrowIcon){
     66                                            domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
     67                                        }
     68                                        show.play();
     69                                        folded = false;
     70                                    } else {
     71                                        // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode
     72                                        var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", selectorLine.buttonsNode)[0];  // Query the up arrow rftIcon span
     73                                        if (upArrowIcon){
     74                                            domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
     75                                        }
     76                                        hide.play();
     77                                        folded = true;
     78                           
    5779                                    }
    58                                     show.play();
    59                                     folded = false;
    60                                 } else {
    61                                     // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode
    62                                     var upArrowIcon = dojo.query(".rftInlineButton .rftIconHalfArrowUp", selectorLine.buttonsNode)[0];  // Query the up arrow rftIcon span
    63                                     if (upArrowIcon){
    64                                         domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
    65                                     }
    66                                     hide.play();
    67                                     folded = true;
    68                            
    69                                 }
    70                                 e.preventDefault();
    71                                 e.stopPropagation();
    72                             };
    73                         })()
     80                                    e.preventDefault();
     81                                    e.stopPropagation();
     82                                };
     83                            })(),
     84                            properties: {
     85                                blockButton: true,
     86                                color: this.color,
     87                                showLabel: false
     88                            }
     89                        }
    7490                    }
    7591                },this.selectedItemNode);
     
    7793                    title: 'Are there direct colleagues among the other participants?',
    7894                    actions: {
    79                         "Inspect" : infoFunction
     95                        "Inspect" : {
     96                            callback: infoFunction,
     97                            properties: {
     98                                blockButton: false,
     99                                showLabel: false
     100                            }
     101                        }
    80102                    }
    81103                }).placeAt(this.optionsNode);
     104                /*
    82105                new LineWithActionsWidget({
    83106                    title: 'Do you personally know ithers present at the current session?',
     
    92115                    }
    93116                }).placeAt(this.optionsNode);
     117                */
    94118            }
    95119        });
Note: See TracChangeset for help on using the changeset viewer.