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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
9722e744
Commit
9722e744
authored
Mar 10, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify code
parent
f5a9d52f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js
...Item/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js
+5
-12
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_gadgetfield.js.js
View file @
9722e744
...
...
@@ -36,8 +36,7 @@
scrollTop
:
window
.
pageYOffset
,
scrollLeft
:
window
.
pageXOffset
};
element
.
className
=
(
element
.
className
||
""
)
+
"
"
+
gadget
.
props
.
maximize_classname
;
element
.
classList
.
add
(
"
ui-content-maximize
"
);
// XXX tell sub gadget that now it is maximized (call subgadget.onMaximizeChange?)
// this way the parent gadget can decide to set the sub gadget unmaximized later
// for instance: if the user clicks on a button that changes the ui, the maximized
...
...
@@ -50,15 +49,12 @@
gadget
.
props
.
maximize_restore_state
.
gadget_scope
!==
subgadget_scope
)
{
return
false
;
// do not raise, like html5 requestFullScreen
}
var
maximized_element_list
=
gadget
.
props
.
element
.
querySelectorAll
(
"
.
"
+
gadget
.
props
.
maximize_classname
);
var
maximized_element_list
=
gadget
.
props
.
element
.
querySelectorAll
(
"
.ui-content-maximize
"
);
if
([].
indexOf
.
call
(
maximized_element_list
,
element
)
<
0
)
{
return
false
;
// do not raise, like html5 requestFullScreen
}
element
.
className
=
(
element
.
className
||
""
)
.
replace
(
gadget
.
props
.
maximize_classname_search_regexp
,
"
"
)
.
replace
(
/
(?:
^
\s
+|
\s
+$
)
/g
,
""
);
// remove trailing spaces
element
.
classList
.
remove
(
"
ui-content-maximize
"
);
window
.
scrollTo
(
gadget
.
props
.
maximize_restore_state
.
scrollLeft
,
gadget
.
props
.
maximize_restore_state
.
scrollTop
...
...
@@ -81,10 +77,7 @@
/////////////////////////////////////////////////////////////////
// Init local properties
.
ready
(
function
(
g
)
{
g
.
props
=
{
maximize_classname
:
"
ui-content-maximize
"
,
maximize_classname_search_regexp
:
/
(?:
^|
\s)
ui-content-maximize
(?:\s
|$
)
/
};
g
.
props
=
{};
})
// Assign the element to a variable
...
...
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