Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
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 @@
...
@@ -9,10 +9,13 @@
value
:
undefined
,
value
:
undefined
,
checked
:
undefined
,
checked
:
undefined
,
title
:
''
,
title
:
''
,
name
:
''
,
type
:
'
text
'
,
type
:
'
text
'
,
required
:
false
,
required
:
false
,
// mandatory field
trim
:
false
,
trim
:
false
,
// trim content for spaces
focus
:
undefined
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
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
...
@@ -27,13 +30,17 @@
...
@@ -27,13 +30,17 @@
focus
:
options
.
focus
,
focus
:
options
.
focus
,
step
:
options
.
step
,
step
:
options
.
step
,
hidden
:
options
.
hidden
,
hidden
:
options
.
hidden
,
trim
:
options
.
trim
||
false
trim
:
options
.
trim
||
false
,
append
:
options
.
append
,
prepend
:
options
.
prepend
};
};
return
this
.
changeState
(
state_dict
);
return
this
.
changeState
(
state_dict
);
})
})
.
onStateChange
(
function
()
{
.
onStateChange
(
function
(
modification_dict
)
{
var
textarea
=
this
.
element
.
querySelector
(
'
input
'
);
var
textarea
=
this
.
element
.
querySelector
(
'
input
'
),
tmp
;
// general use short-scope variable
if
(
this
.
state
.
type
===
'
checkbox
'
)
{
if
(
this
.
state
.
type
===
'
checkbox
'
)
{
textarea
.
checked
=
this
.
state
.
checked
;
textarea
.
checked
=
this
.
state
.
checked
;
}
else
{
}
else
{
...
@@ -81,6 +88,22 @@
...
@@ -81,6 +88,22 @@
textarea
.
autofocus
=
false
;
textarea
.
autofocus
=
false
;
textarea
.
blur
();
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
()
{
.
declareService
(
function
()
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
5a15482b
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
961.
1644.62757.27801
</string>
</value>
<value>
<string>
961.
40519.18664.56814
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
150
1232763.54
</float>
<float>
150
3560196.31
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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