Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit ae36e6b

Browse files
authored
Merge branch 'master' into greenkeeper-grunt-contrib-uglify-2.3.0
2 parents 1d892f9 + d025932 commit ae36e6b

File tree

19 files changed

+80
-40
lines changed

19 files changed

+80
-40
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<h2>Checkboxes</h2>
5959
<div class="thin-box">
6060
<section id="checkboxes-block">
61-
61+
<div id="myCheckbox1Wrapper" style="width: 300px;"></div>
6262
<div class="checkbox" id="myCheckbox">
6363
<label class="checkbox-custom" data-initialize="checkbox" id="myCustomCheckbox1">
6464
<input class="sr-only" type="checkbox" value="" />

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ define(function (require) {
3030
CHECKBOX
3131
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3232

33+
var checkbox = require('hbs!fuelux_templates/checkbox');
34+
var $myCheckbox1Wrapper = $('#myCheckbox1Wrapper');
35+
$myCheckbox1Wrapper.html(checkbox({ id: 'myCheckbox1', required: true, validation: 'error', label: 'Checkboxes', checkboxes: [{label: 'Checkbox Label 1' }, {label: 'Checkbox Label 2' }]}));
36+
3337
// sample method buttons
3438
$('#btnCheckboxToggle').on('click', function () {
3539
$('#myCustomCheckbox1').checkbox('toggle');

js/spinbox.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@
167167
},
168168

169169
render: function render() {
170-
this.setValue(this.getDisplayValue());
170+
this._setValue(this.getDisplayValue());
171171
},
172172

173173
change: function change() {
174-
this.setValue(this.getDisplayValue());
174+
this._setValue(this.getDisplayValue());
175175

176176
this.triggerChangedEvent();
177177
},
@@ -222,7 +222,7 @@
222222

223223
step: function step(isIncrease) {
224224
//refresh value from display before trying to increment in case they have just been typing before clicking the nubbins
225-
this.setValue(this.getDisplayValue());
225+
this._setValue(this.getDisplayValue());
226226
var newVal;
227227

228228
if (isIncrease) {
@@ -233,7 +233,7 @@
233233

234234
newVal = newVal.toFixed(5);
235235

236-
this.setValue(newVal + this.unit);
236+
this._setValue(newVal + this.unit);
237237
},
238238

239239
getDisplayValue: function getDisplayValue() {
@@ -255,6 +255,10 @@
255255
},
256256

257257
setValue: function setValue(val) {
258+
return this._setValue(val, true);
259+
},
260+
261+
_setValue: function _setValue(val, shouldSetLastValue) {
258262
//remove any i18n on the number
259263
if (this.options.decimalMark !== '.') {
260264
val = this.parseInput(val);
@@ -271,7 +275,7 @@
271275

272276
//make sure we are dealing with a number
273277
if (isNaN(intVal) && !isFinite(intVal)) {
274-
return this.setValue(this.options.value);
278+
return this._setValue(this.options.value, shouldSetLastValue);
275279
}
276280

277281
//conform
@@ -290,6 +294,10 @@
290294
//display number
291295
this.setDisplayValue(val);
292296

297+
if (shouldSetLastValue) {
298+
this.lastValue = val;
299+
}
300+
293301
return this;
294302
},
295303

less/forms.less

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
.checkbox-radio-hover();
3737
}
3838
}
39-
39+
4040
label, .input-label, label& {
4141
cursor: pointer;
4242
font-weight: normal;
@@ -102,7 +102,7 @@
102102
color: @text-color;
103103
color: @checkbox-primary-color;
104104
cursor: pointer;
105-
105+
106106
&:before {
107107
.checkbox-radio-focus();
108108
outline: none;
@@ -176,12 +176,12 @@
176176

177177

178178

179-
// Allows multiline labels next to checkboxes and radio
179+
// Allows multiline labels next to checkboxes and radio
180180
// Should be wrapped in `<form class="form-horizontal"><div class="form-group">`
181181
.fuelux {
182182

183183
.checkbox.multiline, .radio.multiline {
184-
float: left;
184+
float: left;
185185
margin-left: 15px;
186186
}
187187

@@ -191,9 +191,9 @@
191191
.fuelux {
192192

193193
.checkbox.multiline ~ .control-label, .radio.multiline ~ .control-label {
194-
float: left;
195-
width: 80%;
196-
margin-left: 10px;
194+
float: left;
195+
width: 80%;
196+
margin-left: 10px;
197197
text-align: left;
198198

199199
& > label {
@@ -204,3 +204,16 @@
204204

205205
}
206206

207+
.fuelux {
208+
.form-group {
209+
&.required {
210+
.control-label {
211+
&:before {
212+
content: '*';
213+
color: @text-danger;
214+
margin-right: @margin-xs;
215+
}
216+
}
217+
}
218+
}
219+
}

templates/handlebars/bootstrap/input.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}">
1+
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}{{#if required}} required{{/if}}">
22
{{#if label}}<label for="{{#if id}}{{id}}{{else}}myInput{{/if}}" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{label}}</label>{{/if}}
33
{{#if horizontal}}<div class="col-sm-10">{{/if}}
44
{{#if hasAside}}<div class="input-group">{{/if}}
@@ -29,4 +29,4 @@
2929
{{#if feedback}}<span class="glyphicon glyphicon-{{feedback}} form-control-feedback" aria-hidden="true"></span><span id="{{#if id}}{{id}}{{else}}myInput{{/if}}Status" class="sr-only">({{#if validation}}{{validation}}{{/if}})</span>{{/if}}
3030
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
3131
{{#if horizontal}}</div>{{/if}}
32-
</div>
32+
</div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
1+
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
22
<label class="control-label{{#if horizontal}} col-sm-2{{/if}}" for="{{#if id}}{{id}}{{else}}myTextarea{{/if}}">{{#if label}}{{label}}{{/if}}</label>
33
{{#if horizontal}}<div class="col-sm-10">{{/if}}
44
<textarea class="form-control" id="{{#if id}}{{id}}{{else}}myTextarea{{/if}}" name="{{#if name}}{{name}}{{else}}{{#if id}}{{id}}{{else}}myTextarea{{/if}}{{/if}}" rows="{{#if rows}}{{rows}}{{/if}}"{{#if required}} required{{/if}}{{#if readonly}} readonly{{/if}}{{#if disabled}} disabled{{/if}}>{{#if text}}{{text}}{{/if}}</textarea>
55
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
66
{{#if horizontal}}</div>{{/if}}
7-
</div>
7+
</div>

templates/handlebars/fuelux/checkbox.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
1+
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
22
<label for="{{#if id}}{{id}}{{else}}myCustomCheckboxWrapper{{/if}}" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{#if label}}{{label}}{{/if}}</label>
33

44
<div class="{{#if inline}}checkbox{{/if}}{{#if horizontal}} col-sm-10{{/if}}"{{#if required}} required{{/if}}>
@@ -12,4 +12,4 @@
1212
{{/each}}
1313
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
1414
</div>
15-
</div>
15+
</div>

templates/handlebars/fuelux/combobox.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}">
1+
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}{{#if required}} required{{/if}}">
22
<label for="{{#if id}}{{id}}{{else}}myCombobox{{/if}}Input" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{#if label}}{{label}}{{/if}}</label>
33

44
{{#if horizontal}}<div class="col-sm-10">{{/if}}
@@ -17,4 +17,4 @@
1717
{{#if feedback}}<span class="glyphicon glyphicon-{{feedback}} form-control-feedback" aria-hidden="true"></span><span id="{{#if id}}{{id}}{{else}}myCombobox{{/if}}Status" class="sr-only">({{#if validation}}{{validation}}{{/if}})</span>{{/if}}
1818
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
1919
{{#if horizontal}}</div>{{/if}}
20-
</div>
20+
</div>

templates/handlebars/fuelux/radio.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
1+
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
22
<label for="{{#if id}}{{id}}{{else}}myCustomRadioWrapper{{/if}}" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{#if label}}{{label}}{{/if}}</label>
33

44
<div class="{{#if inline}}radio{{/if}}{{#if horizontal}} col-sm-10{{/if}}"{{#if required}} required{{/if}}>
@@ -12,4 +12,4 @@
1212
{{/each}}
1313
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
1414
</div>
15-
</div>
15+
</div>

templates/handlebars/fuelux/selectlist.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
1+
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
22
<label class="control-label{{#if horizontal}} col-sm-2{{/if}}" for="{{#if id}}{{id}}{{else}}mySelectlist{{/if}}">{{#if label}}{{label}}{{/if}}</label>
33
<div class="controls text-{{#if buttonalign}}{{buttonalign}}{{else}}left{{/if}}{{#if horizontal}} col-sm-10{{/if}}">
44
<div class="btn-group selectlist"{{#unless doNotInit}} data-initialize="selectlist"{{/unless}} data-resize="auto" id="{{#if id}}{{id}}{{else}}mySelectlist{{/if}}">
@@ -16,4 +16,4 @@
1616
</div>
1717
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
1818
</div>
19-
</div>
19+
</div>

0 commit comments

Comments
 (0)