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
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
Levin Zimmermann
erp5
Commits
91ff428e
Commit
91ff428e
authored
Jul 28, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Jul 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Solve blurring/emptying of the panel search field in clearer way
parent
02b75940
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
28 deletions
+32
-28
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
...hTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
+18
-20
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
...ateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
+2
-2
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
+7
-1
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_erp5_panel_js.js
View file @
91ff428e
...
@@ -322,37 +322,35 @@
...
@@ -322,37 +322,35 @@
.
onEvent
(
'
submit
'
,
function
(
event
)
{
.
onEvent
(
'
submit
'
,
function
(
event
)
{
var
gadget
=
this
,
var
gadget
=
this
,
search_gadget
,
redirect_options
=
{
redirect_options
=
{
page
:
"
search
"
page
:
"
search
"
};
};
return
gadget
.
getDeclaredGadget
(
"
erp5_searchfield
"
)
return
gadget
.
push
(
function
(
search_gadget
)
{
.
getDeclaredGadget
(
"
erp5_searchfield
"
)
.
push
(
function
(
declared_gadget
)
{
search_gadget
=
declared_gadget
;
return
search_gadget
.
getContent
();
return
search_gadget
.
getContent
();
})
})
.
push
(
function
(
data
)
{
.
push
(
function
(
data
)
{
if
(
data
.
search
)
{
if
(
data
.
search
)
{
redirect_options
.
extended_search
=
data
.
search
;
redirect_options
.
extended_search
=
data
.
search
;
}
}
// don't redirect yet even when we have all necessary arguments
// let the search gadget know its current state (value and focus)
return
gadget
.
getDeclaredGadget
(
"
erp5_searchfield
"
);
// in order to be able to zero it out in the next Promise
})
// input gadget's state does not reflect immediate reality
.
push
(
function
(
search_gadget
)
{
// so we need to manage its state from the parent
// we want the search field in side panel to be empty and blured
// but the state of the search gadget is still empty and blurred
// because the search gadget does not catch onSubmit
// thus we need to modify its state with the submitted values
// and then modify it back to nothing so the "nothing" gets rendered
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
search_gadget
.
render
({
return
search_gadget
.
render
({
extended_search
:
redirect_options
.
extended_search
,
extended_search
:
data
.
search
,
focus
:
true
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
// we want the search field in side panel to be empty and blured
return
search_gadget
.
render
({
return
search_gadget
.
render
({
extended_search
:
''
extended_search
:
''
,
});
focus
:
false
// we don't want focus on the empty field for sure
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
91ff428e
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.63261.10188.49271
</string>
</value>
<value>
<string>
96
1.1708.1551.12032
</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>
1501
172620.25
</float>
<float>
1501
231473.84
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
View file @
91ff428e
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
var
gadget
=
this
;
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
'
input
'
)
return
gadget
.
getDeclaredGadget
(
'
input
'
)
.
push
(
function
(
input_gadget
)
{
.
push
(
function
(
input_gadget
)
{
var
focus
=
gadget
.
state
.
focus
||
false
;
var
focus
=
gadget
.
state
.
focus
;
// undefined focus is fine as well
if
(
gadget
.
state
.
focus
===
undefined
&&
!
gadget
.
state
.
extended_search
)
{
if
(
gadget
.
state
.
focus
===
undefined
&&
!
gadget
.
state
.
extended_search
)
{
focus
=
true
;
focus
=
true
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
View file @
91ff428e
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.63097.14876.50483
</string>
</value>
<value>
<string>
96
1.1709.1577.19712
</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>
1501
172560.38
</float>
<float>
1501
231535.25
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
View file @
91ff428e
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
title
:
''
,
title
:
''
,
type
:
'
text
'
,
type
:
'
text
'
,
required
:
false
,
required
:
false
,
trim
:
false
trim
:
false
,
focus
:
undefined
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
...
@@ -75,6 +76,11 @@
...
@@ -75,6 +76,11 @@
textarea
.
autofocus
=
true
;
textarea
.
autofocus
=
true
;
textarea
.
focus
();
textarea
.
focus
();
}
}
if
(
this
.
state
.
focus
===
false
)
{
textarea
.
autofocus
=
false
;
textarea
.
blur
();
}
})
})
.
declareService
(
function
()
{
.
declareService
(
function
()
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
91ff428e
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
56.58742.58866.48708
</string>
</value>
<value>
<string>
9
61.1644.62757.27801
</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>
1
490622626.22
</float>
<float>
1
501232763.54
</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