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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
f2c3d48c
Commit
f2c3d48c
authored
Nov 23, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] add possibility to hide panel in desktop view
parent
f19a3c76
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
14 deletions
+57
-14
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.js
...TemplateItem/web_page_module/rjs_gadget_erp5_header_js.js
+16
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
+3
-3
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
+16
-1
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
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
+17
-5
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
+3
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.js
View file @
f2c3d48c
...
...
@@ -130,6 +130,11 @@
modified
:
true
});
})
.
declareMethod
(
'
setDesktopMode
'
,
function
(
isDesktop
)
{
return
this
.
changeState
({
desktop
:
isDesktop
});
})
/*
.declareMethod('notifyUpdate', function () {
return this.render(this.stats.options);
...
...
@@ -228,6 +233,17 @@
default_right_icon
=
""
,
title_link
,
promise_list
=
[];
if
(
modification_dict
.
hasOwnProperty
(
'
desktop
'
))
{
if
(
this
.
state
.
desktop
)
{
if
(
this
.
element
.
classList
.
contains
(
'
tablet-mode
'
))
{
this
.
element
.
classList
.
remove
(
'
tablet-mode
'
);
}
}
else
{
if
(
!
this
.
element
.
classList
.
contains
(
'
tablet-mode
'
))
{
this
.
element
.
classList
.
toggle
(
'
tablet-mode
'
);
}
}
}
// Main title
if
(
modification_dict
.
hasOwnProperty
(
'
error
'
)
||
modification_dict
.
hasOwnProperty
(
'
loaded
'
)
||
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
View file @
f2c3d48c
...
...
@@ -216,7 +216,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.19028.47293.9045
</string>
</value>
<value>
<string>
96
3.43879.9730.43520
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
02270945.98
</float>
<float>
15
11881522.84
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
f2c3d48c
...
...
@@ -429,6 +429,19 @@
.
allowPublicAcquisition
(
'
triggerPanel
'
,
function
()
{
return
route
(
this
,
"
panel
"
,
"
toggle
"
);
})
.
allowPublicAcquisition
(
'
setDesktopMode
'
,
function
(
param_list
)
{
this
.
props
.
desktop_mode
=
param_list
[
0
];
if
(
param_list
[
0
])
{
if
(
this
.
props
.
content_element
.
classList
.
contains
(
'
tablet-mode
'
))
{
this
.
props
.
content_element
.
classList
.
remove
(
'
tablet-mode
'
);
}
}
else
{
if
(
!
this
.
props
.
content_element
.
classList
.
contains
(
'
tablet-mode
'
))
{
this
.
props
.
content_element
.
classList
.
toggle
(
'
tablet-mode
'
);
}
}
return
route
(
this
,
"
header
"
,
"
setDesktopMode
"
,
[
param_list
[
0
]]);
})
.
allowPublicAcquisition
(
'
renderEditorPanel
'
,
function
(
param_list
)
{
return
route
(
this
,
"
editor_panel
"
,
'
render
'
,
param_list
);
})
...
...
@@ -561,9 +574,11 @@
})
.
push
(
function
()
{
var
promise_list
=
[
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
editor_panel
'
,
'
close
'
)
];
if
(
!
gadget
.
props
.
desktop_mode
)
{
promise_list
.
push
(
route
(
gadget
,
'
panel
'
,
'
close
'
));
}
if
(
keep_message
!==
true
)
{
promise_list
.
push
(
route
(
gadget
,
'
notification
'
,
'
close
'
));
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
f2c3d48c
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
963.
7551.15104.28279
</string>
</value>
<value>
<string>
963.
49583.4046.44697
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
09376504.09
</float>
<float>
15
11882028.25
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
View file @
f2c3d48c
...
...
@@ -8,6 +8,7 @@
/////////////////////////////////////////////////////////////////
// Precompile templates while loading the first gadget instance
var
gadget_klass
=
rJS
(
window
),
matchMedia
=
window
.
matchMedia
(
"
(min-width: 85em)
"
),
template_element
=
gadget_klass
.
__template_element
,
panel_template_header
=
Handlebars
.
compile
(
template_element
.
getElementById
(
"
panel-template-header
"
)
...
...
@@ -25,7 +26,7 @@
gadget_klass
.
setState
({
visible
:
false
,
desktop
:
false
desktop
:
matchMedia
.
matches
})
//////////////////////////////////////////////
// acquired method
...
...
@@ -35,6 +36,7 @@
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
setDesktopMode
"
,
"
setDesktopMode
"
)
/////////////////////////////////////////////////////////////////
// declared methods
...
...
@@ -97,6 +99,14 @@
}
}
}
if
(
modification_dict
.
hasOwnProperty
(
'
desktop
'
)
||
modification_dict
.
hasOwnProperty
(
"
visible
"
))
{
queue
.
push
(
function
()
{
return
gadget
.
setDesktopMode
(
gadget
.
state
.
visible
&&
gadget
.
state
.
desktop
);
});
}
if
(
modification_dict
.
hasOwnProperty
(
"
global
"
))
{
queue
...
...
@@ -280,13 +290,15 @@
event
,
context
=
this
;
function
extractSizeAndDispatch
()
{
if
(
window
.
matchMedia
(
"
(min-width: 85em)
"
)
.
matches
)
{
if
(
matchMedia
.
matches
)
{
return
context
.
changeState
({
desktop
:
true
desktop
:
true
,
visible
:
true
});
}
return
context
.
changeState
({
desktop
:
false
desktop
:
false
,
visible
:
false
});
}
result
=
loopEventListener
(
window
,
'
resize
'
,
false
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
f2c3d48c
...
...
@@ -216,7 +216,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.1708.1551.12032
</string>
</value>
<value>
<string>
96
3.49579.37797.17544
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
01231473.84
</float>
<float>
15
11882299.1
</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