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.5 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.BlockButton", [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: "rftBlockButton", |
---|
10 | postMixInProperties: function(){ |
---|
11 | if (this.iconType == "none" || this.iconType == null) { |
---|
12 | this.iconClass = "dijitNoIcon"; |
---|
13 | } else { |
---|
14 | this.iconClass = "rftIcon rftIcon"+this.iconType; |
---|
15 | } |
---|
16 | this.inherited(arguments); |
---|
17 | }, |
---|
18 | postCreate: function(){ |
---|
19 | var capitalizedHighlightColor = this.highlightColor.charAt(0).toUpperCase() + this.highlightColor.slice(1); |
---|
20 | domClass.add(this.domNode, "highlight"+capitalizedHighlightColor); |
---|
21 | this.inherited(arguments); |
---|
22 | } |
---|
23 | }); |
---|
24 | }); |
---|
25 | |
---|
26 | /* DESCRIPTION: |
---|
27 | * |
---|
28 | * A configuration preset for dijit.form.Button. Automatically sets certain properties on the instantiation instead of having to manually do that in declaration markup |
---|
29 | * BlockButton has no icon (rftIcon.css) and label by default |
---|
30 | * Flat coloured background (highlightColor), no border, 24px height |
---|
31 | * Label is white (#White). Background lights up to white when hovered. |
---|
32 | */ |
---|
Note: See
TracBrowser
for help on using the repository browser.