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
Klaus Wölfel
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
Hide 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 @@
...
@@ -8,39 +8,26 @@
// acquired method
// acquired method
//////////////////////////////////////////////
//////////////////////////////////////////////
.
allowPublicAcquisition
(
'
trigger
'
,
function
trigger
()
{
.
allowPublicAcquisition
(
'
trigger
'
,
function
trigger
()
{
return
this
.
toggl
e
();
return
this
.
clos
e
();
})
})
.
declareMethod
(
'
toggle
'
,
function
toggle
()
{
.
declareMethod
(
'
toggle
'
,
function
toggle
()
{
if
(
this
.
state
.
visible
)
{
return
this
.
close
();
}
return
this
.
changeState
({
return
this
.
changeState
({
visible
:
!
this
.
state
.
visible
url
:
undefined
});
});
})
})
.
declareMethod
(
'
close
'
,
function
close
()
{
.
declareMethod
(
'
close
'
,
function
close
()
{
return
this
.
changeState
({
return
this
.
changeState
({
visible
:
false
,
url
:
undefined
url
:
undefined
,
options
:
undefined
});
});
})
})
.
declareMethod
(
'
render
'
,
function
render
(
url
,
options
)
{
.
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
({
return
this
.
changeState
({
visible
:
true
,
// Hack to close the panel if the sort/filter button
url
:
url
,
// is clicked twice
url
:
(
url
===
this
.
state
.
url
)
?
undefined
:
url
,
options
:
options
options
:
options
});
});
})
})
...
@@ -48,22 +35,19 @@
...
@@ -48,22 +35,19 @@
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
var
queue
,
var
queue
,
gadget
=
this
;
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
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
if
(
this
.
state
.
url
===
undefined
)
{
if
(
this
.
state
.
url
===
undefined
)
{
if
(
this
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
element
.
classList
.
remove
(
'
visible
'
);
}
while
(
this
.
element
.
firstChild
)
{
while
(
this
.
element
.
firstChild
)
{
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
}
}
}
else
{
}
else
{
if
(
!
this
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
element
.
classList
.
toggle
(
'
visible
'
);
}
queue
=
this
.
declareGadget
(
this
.
state
.
url
,
queue
=
this
.
declareGadget
(
this
.
state
.
url
,
{
scope
:
"
declared_gadget
"
});
{
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 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<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>
15
26656627.08
</float>
<float>
15
40559107.01
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
c83cb5e6
...
@@ -466,7 +466,12 @@
...
@@ -466,7 +466,12 @@
})
})
.
allowPublicAcquisition
(
'
renderEditorPanel
'
,
.
allowPublicAcquisition
(
'
renderEditorPanel
'
,
function
renderEditorPanel
(
param_list
)
{
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
)
{
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
jio_allDocs
(
param_list
)
{
return
callJioGadget
(
this
,
"
allDocs
"
,
param_list
);
return
callJioGadget
(
this
,
"
allDocs
"
,
param_list
);
...
@@ -525,7 +530,8 @@
...
@@ -525,7 +530,8 @@
})
})
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
.
onStateChange
(
function
onStateChange
(
modification_dict
)
{
var
gadget
=
this
,
var
gadget
=
this
,
route_result
=
gadget
.
state
;
route_result
=
gadget
.
state
,
promise_list
;
if
(
modification_dict
.
hasOwnProperty
(
'
error_text
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
error_text
'
))
{
return
gadget
.
dropGadget
(
MAIN_SCOPE
)
return
gadget
.
dropGadget
(
MAIN_SCOPE
)
...
@@ -546,8 +552,11 @@
...
@@ -546,8 +552,11 @@
});
});
}
}
promise_list
=
[];
// Update the main gadget
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
return
renderMainGadget
(
promise_list
.
push
(
renderMainGadget
(
gadget
,
gadget
,
route_result
.
url
,
route_result
.
url
,
route_result
.
options
route_result
.
options
...
@@ -575,20 +584,32 @@
...
@@ -575,20 +584,32 @@
// XXX Drop notification
// XXX Drop notification
// return header_gadget.notifyLoaded();
// return header_gadget.notifyLoaded();
}
}
});
}));
}
else
if
(
modification_dict
.
hasOwnProperty
(
'
render_timestamp
'
))
{
// Same subgadget
promise_list
.
push
(
gadget
.
getDeclaredGadget
(
MAIN_SCOPE
)
.
push
(
function
(
page_gadget
)
{
return
page_gadget
.
render
(
gadget
.
state
.
options
);
})
.
push
(
function
()
{
return
RSVP
.
all
([
updateHeader
(
gadget
),
updatePanel
(
gadget
)
]);
}));
}
}
//
Same subgadget
//
Update the editor panel
return
gadget
.
getDeclaredGadget
(
MAIN_SCOPE
)
if
(
modification_dict
.
hasOwnProperty
(
'
editor_panel_url
'
)
||
.
push
(
function
(
page_gadget
)
{
modification_dict
.
hasOwnProperty
(
'
editor_panel_render_timestamp
'
)
)
{
return
page_gadget
.
render
(
gadget
.
state
.
options
);
promise_list
.
push
(
})
route
(
gadget
,
'
editor_panel
'
,
'
render
'
,
.
push
(
function
()
{
[
gadget
.
state
.
editor_panel_url
,
return
RSVP
.
all
([
gadget
.
state
.
editor_panel_options
])
updateHeader
(
gadget
),
);
updatePanel
(
gadget
)
}
]);
}
);
return
RSVP
.
all
(
promise_list
);
})
})
// Render the page
// Render the page
.
declareMethod
(
'
render
'
,
function
render
(
route_result
,
keep_message
)
{
.
declareMethod
(
'
render
'
,
function
render
(
route_result
,
keep_message
)
{
...
@@ -604,7 +625,6 @@
...
@@ -604,7 +625,6 @@
.
push
(
function
()
{
.
push
(
function
()
{
var
promise_list
=
[
var
promise_list
=
[
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
editor_panel
'
,
'
close
'
),
route
(
gadget
,
'
router
'
,
'
notify
'
,
[{
modified
:
false
}])
route
(
gadget
,
'
router
'
,
'
notify
'
,
[{
modified
:
false
}])
];
];
if
(
keep_message
!==
true
)
{
if
(
keep_message
!==
true
)
{
...
@@ -613,8 +633,13 @@
...
@@ -613,8 +633,13 @@
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
changeState
({
url
:
route_result
.
url
,
return
gadget
.
changeState
({
options
:
route_result
.
options
});
url
:
route_result
.
url
,
options
:
route_result
.
options
,
editor_panel_url
:
undefined
,
// Force calling main gadget render
render_timestamp
:
new
Date
().
getTime
()
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
decreaseLoadingCounter
(
gadget
);
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 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<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>
15405
41176.76
</float>
<float>
15405
59619.45
</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