Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
826e7e5e
Commit
826e7e5e
authored
Jun 26, 2017
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plugins: resize plugin dialog when browser window is resized.
parent
bf45449b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
8 deletions
+46
-8
apps/common/main/lib/view/Plugins.js
apps/common/main/lib/view/Plugins.js
+46
-8
No files found.
apps/common/main/lib/view/Plugins.js
View file @
826e7e5e
...
...
@@ -207,10 +207,10 @@ define([
var
header_footer
=
(
_options
.
buttons
&&
_
.
size
(
_options
.
buttons
)
>
0
)
?
85
:
34
;
if
(
!
_options
.
header
)
header_footer
-=
34
;
this
.
bordersOffset
=
(
_options
.
header
)
?
10
:
25
;
_options
.
width
=
(
Common
.
Utils
.
innerWidth
()
-
this
.
bordersOffset
-
_options
.
width
)
<
0
?
Common
.
Utils
.
innerWidth
()
-
this
.
bordersOffset
:
_options
.
width
;
this
.
bordersOffset
=
25
;
_options
.
width
=
(
Common
.
Utils
.
innerWidth
()
-
this
.
bordersOffset
*
2
-
_options
.
width
)
<
0
?
Common
.
Utils
.
innerWidth
()
-
this
.
bordersOffset
*
2
:
_options
.
width
;
_options
.
height
+=
header_footer
;
_options
.
height
=
(
Common
.
Utils
.
innerHeight
()
-
this
.
bordersOffset
-
_options
.
height
)
<
0
?
Common
.
Utils
.
innerHeight
()
-
this
.
bordersOffset
:
_options
.
height
;
_options
.
height
=
(
Common
.
Utils
.
innerHeight
()
-
this
.
bordersOffset
*
2
-
_options
.
height
)
<
0
?
Common
.
Utils
.
innerHeight
()
-
this
.
bordersOffset
*
2
:
_options
.
height
;
_options
.
cls
+=
'
advanced-settings-dlg
'
;
this
.
template
=
[
...
...
@@ -267,6 +267,14 @@ define([
this
.
on
(
'
resizing
'
,
function
(
args
){
me
.
boxEl
.
css
(
'
height
'
,
parseInt
(
me
.
$window
.
css
(
'
height
'
))
-
me
.
_headerFooterHeight
);
});
var
onMainWindowResize
=
function
(){
me
.
onWindowResize
();
};
$
(
window
).
on
(
'
resize
'
,
onMainWindowResize
);
this
.
on
(
'
close
'
,
function
()
{
$
(
window
).
off
(
'
resize
'
,
onMainWindowResize
);
});
},
_onLoad
:
function
()
{
...
...
@@ -278,11 +286,12 @@ define([
setInnerSize
:
function
(
width
,
height
)
{
var
maxHeight
=
Common
.
Utils
.
innerHeight
(),
maxWidth
=
Common
.
Utils
.
innerWidth
(),
borders_width
=
(
parseInt
(
this
.
$window
.
css
(
'
border-left-width
'
))
+
parseInt
(
this
.
$window
.
css
(
'
border-right-width
'
)));
if
(
maxHeight
-
this
.
bordersOffset
<
height
+
this
.
_headerFooterHeight
)
height
=
maxHeight
-
this
.
bordersOffset
-
this
.
_headerFooterHeight
;
if
(
maxWidth
-
this
.
bordersOffset
<
width
+
borders_width
)
width
=
maxWidth
-
this
.
bordersOffset
-
borders_width
;
borders_width
=
(
parseInt
(
this
.
$window
.
css
(
'
border-left-width
'
))
+
parseInt
(
this
.
$window
.
css
(
'
border-right-width
'
))),
bordersOffset
=
this
.
bordersOffset
*
2
;
if
(
maxHeight
-
bordersOffset
<
height
+
this
.
_headerFooterHeight
)
height
=
maxHeight
-
bordersOffset
-
this
.
_headerFooterHeight
;
if
(
maxWidth
-
bordersOffset
<
width
+
borders_width
)
width
=
maxWidth
-
bordersOffset
-
borders_width
;
this
.
boxEl
.
css
(
'
height
'
,
height
);
...
...
@@ -293,6 +302,35 @@ define([
this
.
$window
.
css
(
'
top
'
,((
maxHeight
-
height
-
this
.
_headerFooterHeight
)
/
2
)
*
0.9
);
},
onWindowResize
:
function
()
{
var
main_width
=
Common
.
Utils
.
innerWidth
(),
main_height
=
Common
.
Utils
.
innerHeight
(),
win_width
=
this
.
getWidth
(),
win_height
=
this
.
getHeight
(),
bordersOffset
=
(
this
.
resizable
)
?
0
:
this
.
bordersOffset
;
if
(
win_height
<
main_height
-
bordersOffset
*
2
+
0.1
&&
win_width
<
main_width
-
bordersOffset
*
2
+
0.1
)
{
var
left
=
this
.
getLeft
(),
top
=
this
.
getTop
();
if
(
top
<
bordersOffset
)
this
.
$window
.
css
(
'
top
'
,
bordersOffset
);
else
if
(
top
+
win_height
>
main_height
-
bordersOffset
)
this
.
$window
.
css
(
'
top
'
,
main_height
-
bordersOffset
-
win_height
);
if
(
left
<
bordersOffset
)
this
.
$window
.
css
(
'
left
'
,
bordersOffset
);
else
if
(
left
+
win_width
>
main_width
-
bordersOffset
)
this
.
$window
.
css
(
'
left
'
,
main_width
-
bordersOffset
-
win_width
);
}
else
{
if
(
win_height
>
main_height
-
bordersOffset
*
2
)
{
this
.
setHeight
(
Math
.
max
(
main_height
-
bordersOffset
*
2
,
this
.
initConfig
.
minheight
));
this
.
boxEl
.
css
(
'
height
'
,
Math
.
max
(
main_height
-
bordersOffset
*
2
,
this
.
initConfig
.
minheight
)
-
this
.
_headerFooterHeight
);
this
.
$window
.
css
(
'
top
'
,
bordersOffset
);
}
if
(
win_width
>
main_width
-
bordersOffset
*
2
)
{
this
.
setWidth
(
Math
.
max
(
main_width
-
bordersOffset
*
2
,
this
.
initConfig
.
minwidth
));
this
.
$window
.
css
(
'
left
'
,
bordersOffset
);
}
}
},
textLoading
:
'
Loading
'
},
Common
.
Views
.
PluginDlg
||
{}));
});
\ No newline at end of file
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