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
Paul Graydon
erp5
Commits
c83cb5e6
Commit
c83cb5e6
authored
Oct 26, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Load the editor panel gadget only if user click on a related button
parent
c4d2fe8e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
50 deletions
+59
-50
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
...teItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
+12
-28
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
...eItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+43
-18
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
View file @
c83cb5e6
...
...
@@ -8,39 +8,26 @@
// acquired method
//////////////////////////////////////////////
.
allowPublicAcquisition
(
'
trigger
'
,
function
trigger
()
{
return
this
.
toggl
e
();
return
this
.
clos
e
();
})
.
declareMethod
(
'
toggle
'
,
function
toggle
()
{
if
(
this
.
state
.
visible
)
{
return
this
.
close
();
}
return
this
.
changeState
({
visible
:
!
this
.
state
.
visible
url
:
undefined
});
})
.
declareMethod
(
'
close
'
,
function
close
()
{
return
this
.
changeState
({
visible
:
false
,
url
:
undefined
,
options
:
undefined
url
:
undefined
});
})
.
declareMethod
(
'
render
'
,
function
render
(
url
,
options
)
{
// XXX Hack to close the panel if the sort/filter button
// is clicked twice
if
(
url
===
this
.
state
.
url
)
{
return
this
.
changeState
({
visible
:
false
,
url
:
undefined
,
options
:
undefined
});
}
return
this
.
changeState
({
visible
:
true
,
url
:
url
,
// Hack to close the panel if the sort/filter button
// is clicked twice
url
:
(
url
===
this
.
state
.
url
)
?
undefined
:
url
,
options
:
options
});
})
...
...
@@ -48,22 +35,19 @@
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
var
queue
,
gadget
=
this
;
if
(
this
.
state
.
visible
)
{
if
(
!
this
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
element
.
classList
.
toggle
(
'
visible
'
);
}
}
else
{
if
(
this
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
element
.
classList
.
remove
(
'
visible
'
);
}
}
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
if
(
this
.
state
.
url
===
undefined
)
{
if
(
this
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
element
.
classList
.
remove
(
'
visible
'
);
}
while
(
this
.
element
.
firstChild
)
{
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
}
}
else
{
if
(
!
this
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
element
.
classList
.
toggle
(
'
visible
'
);
}
queue
=
this
.
declareGadget
(
this
.
state
.
url
,
{
scope
:
"
declared_gadget
"
});
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
View file @
c83cb5e6
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
63.11788.48702.26146
</string>
</value>
<value>
<string>
9
71.13319.43014.16520
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
26656627.08
</float>
<float>
15
40559107.01
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
c83cb5e6
...
...
@@ -466,7 +466,12 @@
})
.
allowPublicAcquisition
(
'
renderEditorPanel
'
,
function
renderEditorPanel
(
param_list
)
{
return
route
(
this
,
"
editor_panel
"
,
'
render
'
,
param_list
);
return
this
.
changeState
({
// Force calling editor panel render
editor_panel_render_timestamp
:
new
Date
().
getTime
(),
editor_panel_url
:
param_list
[
0
],
editor_panel_options
:
param_list
[
1
]
});
})
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
jio_allDocs
(
param_list
)
{
return
callJioGadget
(
this
,
"
allDocs
"
,
param_list
);
...
...
@@ -525,7 +530,8 @@
})
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
var
gadget
=
this
,
route_result
=
gadget
.
state
;
route_result
=
gadget
.
state
,
promise_list
;
if
(
modification_dict
.
hasOwnProperty
(
'
error_text
'
))
{
return
gadget
.
dropGadget
(
MAIN_SCOPE
)
...
...
@@ -546,8 +552,11 @@
});
}
promise_list
=
[];
// Update the main gadget
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
return
renderMainGadget
(
promise_list
.
push
(
renderMainGadget
(
gadget
,
route_result
.
url
,
route_result
.
options
...
...
@@ -575,11 +584,10 @@
// XXX Drop notification
// return header_gadget.notifyLoaded();
}
});
}
}));
}
else
if
(
modification_dict
.
hasOwnProperty
(
'
render_timestamp
'
))
{
// Same subgadget
return
gadget
.
getDeclaredGadget
(
MAIN_SCOPE
)
promise_list
.
push
(
gadget
.
getDeclaredGadget
(
MAIN_SCOPE
)
.
push
(
function
(
page_gadget
)
{
return
page_gadget
.
render
(
gadget
.
state
.
options
);
})
...
...
@@ -588,7 +596,20 @@
updateHeader
(
gadget
),
updatePanel
(
gadget
)
]);
});
}));
}
// Update the editor panel
if
(
modification_dict
.
hasOwnProperty
(
'
editor_panel_url
'
)
||
modification_dict
.
hasOwnProperty
(
'
editor_panel_render_timestamp
'
))
{
promise_list
.
push
(
route
(
gadget
,
'
editor_panel
'
,
'
render
'
,
[
gadget
.
state
.
editor_panel_url
,
gadget
.
state
.
editor_panel_options
])
);
}
return
RSVP
.
all
(
promise_list
);
})
// Render the page
.
declareMethod
(
'
render
'
,
function
render
(
route_result
,
keep_message
)
{
...
...
@@ -604,7 +625,6 @@
.
push
(
function
()
{
var
promise_list
=
[
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
editor_panel
'
,
'
close
'
),
route
(
gadget
,
'
router
'
,
'
notify
'
,
[{
modified
:
false
}])
];
if
(
keep_message
!==
true
)
{
...
...
@@ -613,8 +633,13 @@
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
()
{
return
gadget
.
changeState
({
url
:
route_result
.
url
,
options
:
route_result
.
options
});
return
gadget
.
changeState
({
url
:
route_result
.
url
,
options
:
route_result
.
options
,
editor_panel_url
:
undefined
,
// Force calling main gadget render
render_timestamp
:
new
Date
().
getTime
()
});
})
.
push
(
function
()
{
return
decreaseLoadingCounter
(
gadget
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
c83cb5e6
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
971.13
016.8122.59972
</string>
</value>
<value>
<string>
971.13
336.56125.62259
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15405
41176.76
</float>
<float>
15405
59619.45
</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