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
b475bb5f
Commit
b475bb5f
authored
Aug 04, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging resizable plugins.
parent
bc0a3bff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
apps/common/main/lib/controller/Plugins.js
apps/common/main/lib/controller/Plugins.js
+14
-4
apps/common/main/lib/view/Plugins.js
apps/common/main/lib/view/Plugins.js
+13
-9
No files found.
apps/common/main/lib/controller/Plugins.js
View file @
b475bb5f
...
...
@@ -226,7 +226,9 @@ define([
var
me
=
this
,
arrBtns
=
variation
.
get_Buttons
(),
newBtns
=
{},
size
=
variation
.
get_Size
();
size
=
variation
.
get_Size
(),
maxsize
=
variation
.
get_MaximumSize
(),
minsize
=
variation
.
get_MinimumSize
();
if
(
!
size
||
size
.
length
<
2
)
size
=
[
800
,
600
];
if
(
_
.
isArray
(
arrBtns
))
{
...
...
@@ -242,7 +244,11 @@ define([
height
:
size
[
1
],
// inner height
url
:
_baseUrl
+
variation
.
get_Url
(),
buttons
:
newBtns
,
toolcallback
:
_
.
bind
(
this
.
onToolClose
,
this
)
toolcallback
:
_
.
bind
(
this
.
onToolClose
,
this
),
maxwidth
:
maxsize
[
0
],
maxheight
:
maxsize
[
1
],
minwidth
:
minsize
[
0
],
minheight
:
minsize
[
1
]
});
me
.
pluginDlg
.
on
(
'
render:after
'
,
function
(
obj
){
obj
.
getChild
(
'
.footer .dlg-btn
'
).
on
(
'
click
'
,
_
.
bind
(
me
.
onDlgBtnClick
,
me
));
...
...
@@ -251,6 +257,8 @@ define([
me
.
pluginDlg
=
undefined
;
}).
on
(
'
drag
'
,
function
(
args
){
me
.
api
.
asc_pluginEnableMouseEvents
(
args
[
1
]
==
'
start
'
);
}).
on
(
'
resize
'
,
function
(
args
){
me
.
api
.
asc_pluginEnableMouseEvents
(
args
[
1
]
==
'
start
'
);
});
me
.
pluginDlg
.
show
();
}
...
...
@@ -286,7 +294,8 @@ define([
onPluginMouseUp
:
function
(
x
,
y
)
{
if
(
this
.
pluginDlg
)
{
this
.
pluginDlg
.
binding
.
dragStop
();
if
(
this
.
pluginDlg
.
binding
.
dragStop
)
this
.
pluginDlg
.
binding
.
dragStop
();
if
(
this
.
pluginDlg
.
binding
.
resizeStop
)
this
.
pluginDlg
.
binding
.
resizeStop
();
}
else
Common
.
NotificationCenter
.
trigger
(
'
frame:mouseup
'
,
jQuery
.
Event
(
"
mouseup
"
,
{
pageX
:
x
+
this
.
_moveOffset
.
x
,
pageY
:
y
+
this
.
_moveOffset
.
y
}
));
},
...
...
@@ -294,7 +303,8 @@ define([
onPluginMouseMove
:
function
(
x
,
y
)
{
if
(
this
.
pluginDlg
)
{
var
offset
=
this
.
pluginContainer
.
offset
();
this
.
pluginDlg
.
binding
.
drag
(
jQuery
.
Event
(
"
mousemove
"
,
{
pageX
:
x
+
offset
.
left
,
pageY
:
y
+
offset
.
top
}
));
if
(
this
.
pluginDlg
.
binding
.
drag
)
this
.
pluginDlg
.
binding
.
drag
(
jQuery
.
Event
(
"
mousemove
"
,
{
pageX
:
x
+
offset
.
left
,
pageY
:
y
+
offset
.
top
}
));
if
(
this
.
pluginDlg
.
binding
.
resize
)
this
.
pluginDlg
.
binding
.
resize
(
jQuery
.
Event
(
"
mousemove
"
,
{
pageX
:
x
+
offset
.
left
,
pageY
:
y
+
offset
.
top
}
));
}
else
Common
.
NotificationCenter
.
trigger
(
'
frame:mousemove
'
,
jQuery
.
Event
(
"
mousemove
"
,
{
pageX
:
x
+
this
.
_moveOffset
.
x
,
pageY
:
y
+
this
.
_moveOffset
.
y
}
));
}
...
...
apps/common/main/lib/view/Plugins.js
View file @
b475bb5f
...
...
@@ -230,6 +230,10 @@ define([
Common
.
UI
.
Window
.
prototype
.
render
.
call
(
this
);
this
.
$window
.
find
(
'
> .body
'
).
css
({
height
:
'
auto
'
,
overflow
:
'
hidden
'
});
this
.
boxEl
=
this
.
$window
.
find
(
'
.body > .box
'
);
this
.
_headerFooterHeight
=
(
this
.
options
.
buttons
&&
_
.
size
(
this
.
options
.
buttons
)
>
0
)
?
85
:
34
;
this
.
_headerFooterHeight
+=
((
parseInt
(
this
.
$window
.
css
(
'
border-top-width
'
))
+
parseInt
(
this
.
$window
.
css
(
'
border-bottom-width
'
))));
var
iframe
=
document
.
createElement
(
"
iframe
"
);
iframe
.
id
=
'
plugin_iframe
'
;
iframe
.
name
=
'
pluginFrameEditor
'
,
...
...
@@ -251,6 +255,10 @@ define([
iframe
.
src
=
this
.
url
;
$
(
'
#id-plugin-placeholder
'
).
append
(
iframe
);
this
.
on
(
'
resizing
'
,
function
(
args
){
me
.
boxEl
.
css
(
'
height
'
,
parseInt
(
me
.
$window
.
css
(
'
height
'
))
-
me
.
_headerFooterHeight
);
});
},
_onLoad
:
function
()
{
...
...
@@ -262,23 +270,19 @@ define([
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
,
borders_height
=
(
parseInt
(
this
.
$window
.
css
(
'
border-top-width
'
))
+
parseInt
(
this
.
$window
.
css
(
'
border-bottom-width
'
))),
borders_width
=
(
parseInt
(
this
.
$window
.
css
(
'
border-left-width
'
))
+
parseInt
(
this
.
$window
.
css
(
'
border-right-width
'
)));
if
(
maxHeight
<
height
+
header_footer
+
borders_h
eight
)
height
=
maxHeight
-
header_footer
-
borders_h
eight
;
if
(
maxHeight
<
height
+
this
.
_headerFooterH
eight
)
height
=
maxHeight
-
this
.
_headerFooterH
eight
;
if
(
maxWidth
<
width
+
borders_width
)
width
=
maxWidth
-
borders_width
;
var
$window
=
this
.
getChild
();
var
boxEl
=
$window
.
find
(
'
.body > .box
'
);
boxEl
.
css
(
'
height
'
,
height
);
this
.
boxEl
.
css
(
'
height
'
,
height
);
Common
.
UI
.
Window
.
prototype
.
setHeight
.
call
(
this
,
height
+
header_footer
+
borders_h
eight
);
Common
.
UI
.
Window
.
prototype
.
setHeight
.
call
(
this
,
height
+
this
.
_headerFooterH
eight
);
Common
.
UI
.
Window
.
prototype
.
setWidth
.
call
(
this
,
width
+
borders_width
);
this
.
$window
.
css
(
'
left
'
,(
maxWidth
-
width
-
borders_width
)
/
2
);
this
.
$window
.
css
(
'
top
'
,((
maxHeight
-
height
-
header_footer
-
borders_h
eight
)
/
2
)
*
0.9
);
this
.
$window
.
css
(
'
top
'
,((
maxHeight
-
height
-
this
.
_headerFooterH
eight
)
/
2
)
*
0.9
);
},
textLoading
:
'
Loading
'
...
...
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