source: Dev/branches/rest-dojo-ui/client/rft/ui/LargeButton.js @ 333

Last change on this file since 333 was 333, checked in by tjcschipper, 13 years ago
  • Added rft.ui.InlineButton?, which is another preset like LargeButton? and BlockButton?. This time icon only and no label, made to fit into rftLineWithActions widgets. highlightColor: White/Black? allows for two different versions depending on icon background.
  • Make copies of rft/ui/LineWithActionsWidget and rft/ui/Selector, with -Thijs appended to the classnames. These are an attempt at integrating the newly created buttons in their intended contexts. The original classes and templates are untouched.
  • Changed LargeButton? and BlockButton? to be less hardcoded and just better.
File size: 1.3 KB
Line 
1define([
2    'dojo/_base/declare',
3    'dijit/form/Button',
4    'dojo/dom-class'
5    ], function(declare, Button, domClass){
6        return declare("rft.ui.LargeButton", [Button], {
7            showLabel: true,    // Or false? Documentation is retarded about this boolean... true = no label???
8            highlightColor: "blue", // Use the CSS class "highlightBlue" this adds to style active/hover transitions
9            baseClass: "rftLargeButton",
10            postMixInProperties: function(){
11                this.iconClass = "rftIcon rftIcon"+this.iconType;
12                this.inherited(arguments);
13            },
14            postCreate: function(){
15                var capitalizedHighlightColor = this.highlightColor.charAt(0).toUpperCase() + this.highlightColor.slice(1);
16                domClass.add(this.domNode, "highlight"+capitalizedHighlightColor);
17                this.inherited(arguments);
18            }
19        });
20    });
21   
22/*  DESCRIPTION:
23 * 
24 *  A configuration preset for dijit.form.Button. Automatically sets certain properties on the instantiation instead of having to manually do that in declaration markup
25 *  LargeButton has a 24x24px icon (rftIcon.css) and label by default
26 *  Transparent background, no border, 24px height
27 *  Label is gray (#ButtonText), lights up when hovered (#White)
28 */
Note: See TracBrowser for help on using the repository browser.