Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
74775a3d
Commit
74775a3d
authored
Feb 25, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD typeahead type for forms and dispatcher function rref #5050 refs GH-26
parent
423b3343
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
typeahead.html
app/shared/templates/typeahead.html
+36
-0
form_service.js
app/zetalib/form_service.js
+17
-0
No files found.
app/shared/templates/typeahead.html
0 → 100644
View file @
74775a3d
<div
class=
"form-group {{form.htmlClass}} schema-form-select col-md-12"
ng-class=
"{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}"
>
<label
class=
"control-label {{form.labelHtmlClass}}"
ng-show=
"showTitle()"
>
{{form.title}}
</label>
<!--<div class="form-group input-group">-->
<!--<span class="input-group-btn">-->
<!--<button class="btn btn-default dropdown-toggle" type="button"-->
<!--data-toggle="dropdown">-->
<!--<span class="caret"></span>-->
<!--</button>-->
<!--<ul class="dropdown-menu">-->
<!--<li class="text-center" ng-if="form.gettingTitleMap"><a><span class="loader"></span></a></li>-->
<!--<li ng-repeat="item in form.titleMap">-->
<!--<a ng-click="form.onDropdownSelect(item, form.name)">{{item-->
<!--.name}}</a>-->
<!--</li>-->
<!--</ul>-->
<!--</span>-->
<input
type=
"text"
ng-model=
"$$value$$"
uib-typeahead=
"item.name for item in form.titleMap | filter:$viewValue"
typeahead-wait-ms=
"500"
typeahead-loading=
"loadingTitleMap"
placeholder=
"{{form.title}}"
ng-model-options=
"form.ngModelOptions"
ng-disabled=
"form.readonly"
sf-changed=
"form"
class=
"form-control {{form.fieldHtmlClass}}"
schema-validate=
"form"
name=
"{{form.name}}"
/>
<!--</div>-->
<div
ng-show=
"loadingTitleMap"
class=
"loader"
></div>
<div
class=
"help-block"
sf-message=
"form.description"
></div>
</div>
\ No newline at end of file
app/zetalib/form_service.js
View file @
74775a3d
...
@@ -551,6 +551,23 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
...
@@ -551,6 +551,23 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
int
:
{
default
:
_numbers
},
int
:
{
default
:
_numbers
},
boolean
:
{
default
:
function
()
{}},
boolean
:
{
default
:
function
()
{}},
string
:
{
default
:
function
()
{}},
string
:
{
default
:
function
()
{}},
typeahead
:
{
default
:
function
(
scope
,
v
,
k
)
{
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
type
:
"template"
,
title
:
v
.
title
,
titleMap
:
v
.
titleMap
,
templateUrl
:
"shared/templates/typeahead.html"
,
name
:
k
,
key
:
k
,
onDropdownSelect
:
function
(
item
,
inputname
)
{
scope
.
model
[
k
]
=
item
.
value
;
$timeout
(
function
()
{
document
.
querySelector
(
'input[name='
+
inputname
+
']'
).
value
=
item
.
name
;
});
}
};
v
.
type
=
'string'
;
}},
text_general
:
{
text_general
:
{
default
:
default
:
function
(
scope
,
v
,
k
)
{
function
(
scope
,
v
,
k
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment