Ignore:
Timestamp:
06/04/12 16:18:24 (13 years ago)
Author:
tjcschipper
Message:
  • Changed linewithactions and selector -options- property to -modifiers-: more general approach. These extra classes are applied to the root domNode of the widget during the postCreate phase instead.
  • Changed rftSelector.css stuff to match this change, and allow for separate colouring of a selector and its contents.
File:
1 edited

Legend:

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

    r335 r338  
    1 define(['dojo/_base/declare','dojo/_base/lang','dojo/on','dojo/dom','dijit/form/Button',
     1define(['dojo/_base/declare','dojo/_base/lang','dojo/on','dojo/dom', 'dojo/dom-class', 'dijit/form/Button',
    22    'dijit/_WidgetBase','dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin',
    33    'dojo/text!./templates/LineWithActionsWidget.html'
    44],
    5     function(declare,lang,on,dom,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
     5    function(declare,lang,on,dom,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
    66        return declare('rft.ui.LineWithActionsWidgetThijs',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
    77            templateString: templateString,
    88            baseClass: 'rftLineWithButtons',
    99            title: '',
    10             color: "blue",
     10            modifiers: "red",
    1111            userObject: null,
    1212            actions: {},
     
    1818                this.inherited(arguments);
    1919                this._setupActions();
     20                domClass.add(this.domNode, this.modifiers);
    2021                this.refresh();
    2122            },
     
    2425                   
    2526                    if (this.actions[action].properties.blockButton == true) {  // BlockButton
    26                         new Button(
    27                             lang.mixin({
    28                                 baseClass: 'rftBlockButton',
    29                                 "class": this.color,
    30                                 label: action,
    31                                 iconClass: 'rftIcon rftIcon'+action,
    32                                 title: action,
    33                                 onClick: lang.hitch(this, function(){
    34                                     this.actions[action].callback(this.userObject);
    35                                 })
    36                             }, this.actions[action].properties)).placeAt(this.buttonsNode);
     27                        var properties = lang.mixin(
     28                        {
     29                            baseClass: 'rftBlockButton',
     30                            modifiers: this.modifiers,
     31                            label: action,
     32                            iconClass: 'rftIcon rftIcon'+action,
     33                            title: action,
     34                            onClick: lang.hitch(this, function(){
     35                                this.actions[action].callback(this.userObject);
     36                            })
     37                        },
     38                        this.actions[action].properties);
     39                        properties["class"] = properties.modifiers;
     40                       
     41                        new Button(properties).placeAt(this.buttonsNode);
    3742                    } else {    //InlineButton
    3843                        new Button(
     
    4853                            }, this.actions[action].properties)).placeAt(this.buttonsNode);
    4954                    }
    50                    
    51                    
    52                    
    53                 /*  THIS USES DEPRECATED CLASSES!!!
    54                     if (this.actions[action].blockButton == true) {    // BlockButton!
    55                         new BlockButton({
    56                             label: action,
    57                             iconType: action,
    58                             highlightColor: this.actions[action].color || "green",
    59                             onClick: lang.hitch(this, function(){
    60                                 this.actions[action].callback(this.userObject);
    61                             })
    62                         }).placeAt(this.buttonsNode);
    63                        
    64                     } else {    // InlineButton!
    65                         new InlineButton({
    66                             label: action,
    67                             iconType: action,
    68                             highlightColor: "Black",
    69                             onClick: lang.hitch(this, function(){
    70                                 this.actions[action].callback(this.userObject);
    71                             })
    72                         }).placeAt(this.buttonsNode);
    73                     }
    74                     */
    7555                }
    7656            },
Note: See TracChangeset for help on using the changeset viewer.