Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
5a15482b
Commit
5a15482b
authored
Aug 29, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Sep 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] HTML5 Input can display pre/a-ppending text (useful for percentages)
parent
25ae891b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
...TemplateItem/web_page_module/rjs_gadget_html5_input_js.js
+29
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
...emplateItem/web_page_module/rjs_gadget_html5_input_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
View file @
5a15482b
...
...
@@ -9,10 +9,13 @@
value
:
undefined
,
checked
:
undefined
,
title
:
''
,
name
:
''
,
type
:
'
text
'
,
required
:
false
,
trim
:
false
,
focus
:
undefined
required
:
false
,
// mandatory field
trim
:
false
,
// trim content for spaces
focus
:
undefined
,
// has focus by default
prepend
:
undefined
,
// text to prepend infront the field
append
:
undefined
// text to apend after the field
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
...
...
@@ -27,13 +30,17 @@
focus
:
options
.
focus
,
step
:
options
.
step
,
hidden
:
options
.
hidden
,
trim
:
options
.
trim
||
false
trim
:
options
.
trim
||
false
,
append
:
options
.
append
,
prepend
:
options
.
prepend
};
return
this
.
changeState
(
state_dict
);
})
.
onStateChange
(
function
()
{
var
textarea
=
this
.
element
.
querySelector
(
'
input
'
);
.
onStateChange
(
function
(
modification_dict
)
{
var
textarea
=
this
.
element
.
querySelector
(
'
input
'
),
tmp
;
// general use short-scope variable
if
(
this
.
state
.
type
===
'
checkbox
'
)
{
textarea
.
checked
=
this
.
state
.
checked
;
}
else
{
...
...
@@ -81,6 +88,22 @@
textarea
.
autofocus
=
false
;
textarea
.
blur
();
}
if
(
modification_dict
.
append
)
{
this
.
element
.
classList
.
add
(
'
ui-input-has-appendinx
'
);
tmp
=
document
.
createElement
(
'
i
'
);
tmp
.
appendChild
(
document
.
createTextNode
(
modification_dict
.
append
));
this
.
element
.
appendChild
(
tmp
);
tmp
=
undefined
;
}
if
(
modification_dict
.
prepend
)
{
this
.
element
.
classList
.
add
(
'
ui-input-has-prependinx
'
);
tmp
=
document
.
createElement
(
'
i
'
);
tmp
.
appendChild
(
document
.
createTextNode
(
modification_dict
.
append
));
this
.
element
.
insertBefore
(
tmp
,
textarea
);
tmp
=
undefined
;
}
})
.
declareService
(
function
()
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
5a15482b
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
1644.62757.27801
</string>
</value>
<value>
<string>
961.
40519.18664.56814
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
150
1232763.54
</float>
<float>
150
3560196.31
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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