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
a518abfc
Commit
a518abfc
authored
Aug 02, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug with initial size and resizing for plugins window.
parent
c1ac28bf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
44 deletions
+53
-44
apps/common/main/lib/controller/Plugins.js
apps/common/main/lib/controller/Plugins.js
+8
-1
apps/common/main/lib/model/Plugin.js
apps/common/main/lib/model/Plugin.js
+4
-1
apps/common/main/lib/view/Plugins.js
apps/common/main/lib/view/Plugins.js
+29
-39
apps/documenteditor/main/app/controller/Main.js
apps/documenteditor/main/app/controller/Main.js
+4
-1
apps/presentationeditor/main/app/controller/Main.js
apps/presentationeditor/main/app/controller/Main.js
+4
-1
apps/spreadsheeteditor/main/app/controller/Main.js
apps/spreadsheeteditor/main/app/controller/Main.js
+4
-1
No files found.
apps/common/main/lib/controller/Plugins.js
View file @
a518abfc
...
...
@@ -135,6 +135,9 @@ define([
variation
.
set_InitData
(
itemVar
.
get
(
'
initData
'
));
variation
.
set_UpdateOleOnResize
(
itemVar
.
get
(
'
isUpdateOleOnResize
'
));
variation
.
set_Buttons
(
itemVar
.
get
(
'
buttons
'
));
variation
.
set_Size
(
itemVar
.
get
(
'
size
'
));
variation
.
set_MaximumSize
(
itemVar
.
get
(
'
maximumSize
'
));
variation
.
set_MinimumSize
(
itemVar
.
get
(
'
minimumSize
'
));
variationsArr
.
push
(
variation
);
});
plugin
.
set_Variations
(
variationsArr
);
...
...
@@ -223,7 +226,9 @@ define([
}
else
{
var
me
=
this
,
arrBtns
=
variation
.
get_Buttons
(),
newBtns
=
{};
newBtns
=
{},
size
=
variation
.
get_Size
();
if
(
!
size
||
size
.
length
<
2
)
size
=
[
400
,
400
];
if
(
_
.
isArray
(
arrBtns
))
{
_
.
each
(
arrBtns
,
function
(
b
,
index
){
...
...
@@ -234,6 +239,8 @@ define([
var
_baseUrl
=
(
plugin
.
get_BaseUrl
().
length
==
0
)
?
me
.
panelPlugins
.
pluginsPath
:
plugin
.
get_BaseUrl
();
me
.
pluginDlg
=
new
Common
.
Views
.
PluginDlg
({
title
:
plugin
.
get_Name
(),
width
:
size
[
0
],
// inner width
height
:
size
[
1
],
// inner height
url
:
_baseUrl
+
variation
.
get_Url
(),
buttons
:
newBtns
,
toolcallback
:
_
.
bind
(
this
.
onToolClose
,
this
)
...
...
apps/common/main/lib/model/Plugin.js
View file @
a518abfc
...
...
@@ -63,7 +63,10 @@ define([
initDataType
:
0
,
initData
:
""
,
isUpdateOleOnResize
:
false
,
buttons
:
[]
buttons
:
[],
size
:
[
400
,
400
],
maximumSize
:
[],
minimumSize
:
[]
}
}
});
...
...
apps/common/main/lib/view/Plugins.js
View file @
a518abfc
...
...
@@ -187,13 +187,15 @@ define([
initialize
:
function
(
options
)
{
var
_options
=
{};
_
.
extend
(
_options
,
{
width
:
800
,
height
:
(
window
.
innerHeight
-
600
)
<
0
?
window
.
innerHeight
:
600
,
cls
:
'
advanced-settings-dlg
'
,
header
:
true
},
options
);
var
header_footer
=
(
_options
.
buttons
&&
_
.
size
(
_options
.
buttons
)
>
0
)
?
85
:
34
;
_options
.
width
=
(
window
.
innerWidth
-
_options
.
width
)
<
0
?
window
.
innerWidth
:
_options
.
width
,
_options
.
height
+=
header_footer
;
_options
.
height
=
(
window
.
innerHeight
-
_options
.
height
)
<
0
?
window
.
innerHeight
:
_options
.
height
;
this
.
template
=
[
'
<div id="id-plugin-container" class="box" style="height:
'
+
(
_options
.
height
-
header_footer
)
+
'
px;">
'
,
'
<div id="id-plugin-placeholder" style="width: 100%;height: 100%;"></div>
'
,
...
...
@@ -227,59 +229,47 @@ define([
iframe
.
frameBorder
=
0
;
iframe
.
scrolling
=
"
no
"
;
iframe
.
onload
=
_
.
bind
(
this
.
_onLoad
,
this
);
$
(
'
#id-plugin-placeholder
'
).
append
(
iframe
);
this
.
loadMask
=
new
Common
.
UI
.
LoadMask
({
owner
:
$
(
'
#id-plugin-placeholder
'
)});
this
.
loadMask
.
setTitle
(
this
.
textLoading
);
this
.
loadMask
.
show
();
iframe
.
src
=
this
.
url
;
var
me
=
this
;
setTimeout
(
function
(){
if
(
me
.
isLoaded
)
return
;
me
.
loadMask
=
new
Common
.
UI
.
LoadMask
({
owner
:
$
(
'
#id-plugin-placeholder
'
)});
me
.
loadMask
.
setTitle
(
this
.
textLoading
);
me
.
loadMask
.
show
();
if
(
me
.
isLoaded
)
me
.
loadMask
.
hide
();
},
500
);
this
.
on
(
'
close
'
,
function
(
obj
){
});
this
.
on
(
'
show
'
,
function
(
obj
){
var
h
=
me
.
getHeight
();
if
(
window
.
innerHeight
>
h
&&
h
<
600
||
window
.
innerHeight
<
h
)
{
h
=
Math
.
min
(
window
.
innerHeight
,
600
);
me
.
setHeight
(
h
);
}
});
iframe
.
src
=
this
.
url
;
$
(
'
#id-plugin-placeholder
'
).
append
(
iframe
);
},
_onLoad
:
function
()
{
this
.
isLoaded
=
true
;
if
(
this
.
loadMask
)
this
.
loadMask
.
hide
();
},
setHeight
:
function
(
height
)
{
if
(
height
>=
0
)
{
var
min
=
parseInt
(
this
.
$window
.
css
(
'
min-height
'
));
height
<
min
&&
(
height
=
min
);
this
.
$window
.
height
(
height
);
var
header_height
=
(
this
.
initConfig
.
header
)
?
parseInt
(
this
.
$window
.
find
(
'
> .header
'
).
css
(
'
height
'
))
:
0
;
this
.
$window
.
find
(
'
> .body
'
).
css
(
'
height
'
,
height
-
header_height
);
this
.
$window
.
find
(
'
> .body > .box
'
).
css
(
'
height
'
,
height
-
85
);
var
top
=
((
parseInt
(
window
.
innerHeight
)
-
parseInt
(
height
))
/
2
)
*
0.9
;
var
left
=
(
parseInt
(
window
.
innerWidth
)
-
parseInt
(
this
.
initConfig
.
width
))
/
2
;
this
.
$window
.
css
(
'
left
'
,
left
);
this
.
$window
.
css
(
'
top
'
,
top
);
}
},
setInnerSize
:
function
(
width
,
height
)
{
var
maxHeight
=
parseInt
(
window
.
innerHeight
),
maxWidth
=
parseInt
(
window
.
innerWidth
),
header_footer
=
(
this
.
options
.
buttons
&&
_
.
size
(
this
.
options
.
buttons
)
>
0
)
?
85
:
34
;
if
(
maxHeight
<
height
+
header_footer
)
height
=
maxHeight
-
header_footer
;
if
(
maxWidth
<
width
)
width
=
maxWidth
;
var
$window
=
this
.
getChild
();
var
boxEl
=
$window
.
find
(
'
.body > .box
'
);
boxEl
.
css
(
'
height
'
,
height
);
Common
.
UI
.
Window
.
prototype
.
setHeight
.
call
(
this
,
height
+
85
);
Common
.
UI
.
Window
.
prototype
.
setHeight
.
call
(
this
,
height
+
header_footer
);
Common
.
UI
.
Window
.
prototype
.
setWidth
.
call
(
this
,
width
);
var
top
=
((
maxHeight
-
height
-
header_footer
)
/
2
)
*
0.9
;
var
left
=
(
maxWidth
-
width
)
/
2
;
this
.
$window
.
css
(
'
left
'
,(
maxWidth
-
width
)
/
2
);
this
.
$window
.
css
(
'
top
'
,((
maxHeight
-
height
-
header_footer
)
/
2
)
*
0.9
);
},
textLoading
:
'
Loading
'
...
...
apps/documenteditor/main/app/controller/Main.js
View file @
a518abfc
...
...
@@ -1726,7 +1726,10 @@ define([
initDataType
:
itemVar
.
initDataType
,
initData
:
itemVar
.
initData
,
isUpdateOleOnResize
:
itemVar
.
isUpdateOleOnResize
,
buttons
:
itemVar
.
buttons
buttons
:
itemVar
.
buttons
,
size
:
itemVar
.
size
,
minimumSize
:
itemVar
.
minimumSize
,
maximumSize
:
itemVar
.
maximumSize
}));
});
if
(
variationsArr
.
length
>
0
)
...
...
apps/presentationeditor/main/app/controller/Main.js
View file @
a518abfc
...
...
@@ -1512,7 +1512,10 @@ define([
initDataType
:
itemVar
.
initDataType
,
initData
:
itemVar
.
initData
,
isUpdateOleOnResize
:
itemVar
.
isUpdateOleOnResize
,
buttons
:
itemVar
.
buttons
buttons
:
itemVar
.
buttons
,
size
:
itemVar
.
size
,
minimumSize
:
itemVar
.
minimumSize
,
maximumSize
:
itemVar
.
maximumSize
}));
});
if
(
variationsArr
.
length
>
0
)
...
...
apps/spreadsheeteditor/main/app/controller/Main.js
View file @
a518abfc
...
...
@@ -1721,7 +1721,10 @@ define([
initDataType
:
itemVar
.
initDataType
,
initData
:
itemVar
.
initData
,
isUpdateOleOnResize
:
itemVar
.
isUpdateOleOnResize
,
buttons
:
itemVar
.
buttons
buttons
:
itemVar
.
buttons
,
size
:
itemVar
.
size
,
minimumSize
:
itemVar
.
minimumSize
,
maximumSize
:
itemVar
.
maximumSize
}));
});
if
(
variationsArr
.
length
>
0
)
...
...
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