Last change
on this file since 331 was
331,
checked in by tjcschipper, 13 years ago
|
- Added two custom Button classes inheriting from dijit/form/Button. These automatically set CSS classes to properly style these buttons. Both classes take an iconType property (to set icon, null if no icon) and highlightColor property (to set the base/highlight color for the button).
-Proper styling for these classes and the rest of the mockup depends on the dijit/themes/gamelab folder and dijit/icons folder. These are marked as external references, so cannot be committed at this time.
|
File size:
1.3 KB
|
Line | |
---|
1 | define([ |
---|
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 | postMixInProperties: function(){ |
---|
10 | this.iconClass = "rftIcon rftIcon"+this.iconType; |
---|
11 | this.inherited(arguments); |
---|
12 | }, |
---|
13 | postCreate: function(){ |
---|
14 | var capitalizedHighlightColor = this.highlightColor.charAt(0).toUpperCase() + this.highlightColor.slice(1); |
---|
15 | domClass.add(this.domNode, "rftLargeButton highlight"+capitalizedHighlightColor); |
---|
16 | this.inherited(arguments); |
---|
17 | } |
---|
18 | }); |
---|
19 | }); |
---|
20 | |
---|
21 | /* DESCRIPTION: |
---|
22 | * |
---|
23 | * A configuration preset for dijit.form.Button. Automatically sets certain properties on the instantiation instead of having to manually do that in declaration markup |
---|
24 | * LargeButton has a 24x24px icon (rftIcon.css) and label by default |
---|
25 | * Transparent background, no border, 24px height |
---|
26 | * Label is gray (#ButtonText), lights up when hovered (#White) |
---|
27 | */ |
---|
Note: See
TracBrowser
for help on using the repository browser.