Ignore:
Timestamp:
07/03/12 16:57:07 (13 years ago)
Author:
hendrikvanantwerpen
Message:

Merge and integrate mockups in proper pages.

File:
1 edited

Legend:

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

    r316 r350  
    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',
    3     'dojo/text!./templates/LineWithActionsWidget.html'],
    4     function(declare,lang,on,dom,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
     3    'dojo/text!./templates/LineWithActionsWidget.html'
     4    ],
     5    function(declare,lang,on,dom,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
    56        return declare('rft.ui.LineWithActionsWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
    67            templateString: templateString,
    78            baseClass: 'rftLineWithButtons',
    89            title: '',
     10            modifiers: "blue",
    911            userObject: null,
    1012            actions: {},
     
    1618                this.inherited(arguments);
    1719                this._setupActions();
     20                domClass.add(this.domNode, this.modifiers);
    1821                this.refresh();
    1922            },
    2023            _setupActions: function() {
    2124                for (var action in this.actions) {
    22                     new Button({
    23                         label: action,
    24                         //iconClass: 'dijitIconSearch',
    25                         //showLabel: false,
    26                         onClick: lang.hitch(this,function(){
    27                             this.actions[action](this.userObject);
    28                         })
    29                     }).placeAt(this.buttonsNode);
     25                    var properties;
     26                    if (this.actions[action].properties.blockButton == true) {  // BlockButton
     27                        properties = lang.mixin({
     28                            baseClass: 'rftBlockButton',
     29                            modifiers: this.modifiers,
     30                            label: "Default",
     31                            iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
     32                            title: action,
     33                            onClick: lang.hitch(this, this.actions[action].callback)
     34                        }, this.actions[action].properties);
     35                        properties["class"] = properties.modifiers;
     36                        new Button(properties).placeAt(this.buttonsNode);
     37                    } else {    //InlineButton
     38                        properties = lang.mixin({
     39                            baseClass: 'rftInlineButton',
     40                            modifiers: 'black',
     41                            label: "Default",
     42                            showLabel: false,
     43                            iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
     44                            title: action,
     45                            onClick: lang.hitch(this, this.actions[action].callback)
     46                        }, this.actions[action].properties);
     47                        properties["class"] = properties.modifiers;
     48                        new Button(properties).placeAt(this.buttonsNode);
     49                    }
    3050                }
    3151            },
     
    4060                return !preventDefault;
    4161            },
    42             onClick: function(e) {}
     62            onClick: function(e) {},
     63            _setTitleAttr: function(value){
     64                this.title = value;
     65                this.refresh();
     66            }
    4367        });
    4468    });
Note: See TracChangeset for help on using the changeset viewer.