Skip to content

Commit 0fdb369

Browse files
committed
Bug autocomplete + Legend
1 parent b8f3e92 commit 0fdb369

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

dist/lets.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controllers/lets-crud-autocomplete.controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
}
4141

4242
// Check Value
43-
val = val.trim();
43+
if (val.length>0){
44+
val = encodeURIComponent(val.trim())
45+
}
46+
47+
4448
if (val.length == 0 || field.customOptions.select == true) {
4549
val = '[blank]';
4650
}

src/controllers/lets-crud-edit.controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@
5959
if (field.customOptions && field.customOptions.list!=undefined) {
6060
field.customOptions.list.forEach(function(item){
6161
if (item.id==data[field.name]){
62-
data[field.name+'.label'] = item.label;
62+
data[field.name+'.label'] = item;
6363
}
6464
});
65+
}else if (field.autocomplete){
66+
if (data[field.name+'.label'] && "object"!=typeof(data[field.name+'.label'])){
67+
data[field.name+'.label'] = {id:data[field.name].id, label:data[field.name+'.label']};
68+
}
6569
}
6670

6771
if (field.type == 'password'){

src/views/crud/crud-form.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<div class='fixed-caption-block' ng-if="headers.fixed_tab">
33
<fieldset>
44
<legend>
5-
<strong>{{'letsfw.main_information'|locale}}</strong>
5+
<strong ng-if="headers.label_row">{{headers.label_row}}</strong>
6+
<strong ng-if="!headers.label_row">{{'letsfw.main_information'|locale}}</strong>
67
</legend>
78
<ng-include ng-if="beforeForm != undefined" src="beforeForm"></ng-include>
89

@@ -16,8 +17,9 @@
1617

1718
<tab ng-if="headers.main_tabs == undefined" heading="{{headers.label_row}}">
1819
<fieldset>
19-
<legend>
20-
<strong>{{'letsfw.main_information'|locale}}</strong>
20+
<legend ng-show="_.size(headers.tabs) == 0">
21+
<strong ng-if="headers.label_row">{{headers.label_row}}</strong>
22+
<strong ng-if="!headers.label_row">{{'letsfw.main_information'|locale}}</strong>
2123
</legend>
2224
<ng-include ng-if="beforeForm != undefined" src="beforeForm"></ng-include>
2325

0 commit comments

Comments
 (0)