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
bf45449b
Commit
bf45449b
authored
Jun 26, 2017
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring window component.
parent
ab125faf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
apps/common/main/lib/component/Window.js
apps/common/main/lib/component/Window.js
+16
-8
No files found.
apps/common/main/lib/component/Window.js
View file @
bf45449b
...
...
@@ -247,8 +247,8 @@ define([
Common
.
UI
.
Menu
.
Manager
.
hideAll
();
var
zoom
=
(
event
instanceof
jQuery
.
Event
)
?
Common
.
Utils
.
zoom
()
:
1
;
this
.
dragging
.
enabled
=
true
;
this
.
dragging
.
initx
=
event
.
pageX
*
zoom
-
parseInt
(
this
.
$window
.
css
(
'
left
'
)
);
this
.
dragging
.
inity
=
event
.
pageY
*
zoom
-
parseInt
(
this
.
$window
.
css
(
'
top
'
)
);
this
.
dragging
.
initx
=
event
.
pageX
*
zoom
-
this
.
getLeft
(
);
this
.
dragging
.
inity
=
event
.
pageY
*
zoom
-
this
.
getTop
(
);
if
(
window
.
innerHeight
==
undefined
)
{
var
main_width
=
document
.
documentElement
.
offsetWidth
;
...
...
@@ -258,8 +258,8 @@ define([
main_height
=
Common
.
Utils
.
innerHeight
();
}
this
.
dragging
.
maxx
=
main_width
-
parseInt
(
this
.
$window
.
css
(
"
width
"
)
);
this
.
dragging
.
maxy
=
main_height
-
parseInt
(
this
.
$window
.
css
(
"
height
"
)
);
this
.
dragging
.
maxx
=
main_width
-
this
.
getWidth
(
);
this
.
dragging
.
maxy
=
main_height
-
this
.
getHeight
(
);
$
(
document
).
on
(
'
mousemove
'
,
this
.
binding
.
drag
);
$
(
document
).
on
(
'
mouseup
'
,
this
.
binding
.
dragStop
);
...
...
@@ -297,16 +297,16 @@ define([
function
_resizestart
(
event
)
{
Common
.
UI
.
Menu
.
Manager
.
hideAll
();
var
el
=
$
(
event
.
target
),
left
=
parseInt
(
this
.
$window
.
css
(
'
left
'
)
),
top
=
parseInt
(
this
.
$window
.
css
(
'
top
'
)
);
left
=
this
.
getLeft
(
),
top
=
this
.
getTop
(
);
this
.
resizing
.
enabled
=
true
;
this
.
resizing
.
initpage_x
=
event
.
pageX
*
Common
.
Utils
.
zoom
();
this
.
resizing
.
initpage_y
=
event
.
pageY
*
Common
.
Utils
.
zoom
();
this
.
resizing
.
initx
=
this
.
resizing
.
initpage_x
-
left
;
this
.
resizing
.
inity
=
this
.
resizing
.
initpage_y
-
top
;
this
.
resizing
.
initw
=
parseInt
(
this
.
$window
.
css
(
"
width
"
)
);
this
.
resizing
.
inith
=
parseInt
(
this
.
$window
.
css
(
"
height
"
)
);
this
.
resizing
.
initw
=
this
.
getWidth
(
);
this
.
resizing
.
inith
=
this
.
getHeight
(
);
this
.
resizing
.
type
=
[
el
.
hasClass
(
'
left
'
)
?
-
1
:
(
el
.
hasClass
(
'
right
'
)
?
1
:
0
),
el
.
hasClass
(
'
top
'
)
?
-
1
:
(
el
.
hasClass
(
'
bottom
'
)
?
1
:
0
)];
var
main_width
=
(
window
.
innerHeight
==
undefined
)
?
document
.
documentElement
.
offsetWidth
:
Common
.
Utils
.
innerWidth
(),
...
...
@@ -826,6 +826,14 @@ define([
return
this
.
$window
.
find
(
'
> .header > .title
'
).
text
();
},
getLeft
:
function
()
{
return
parseInt
(
this
.
$window
.
css
(
'
left
'
));
},
getTop
:
function
()
{
return
parseInt
(
this
.
$window
.
css
(
'
top
'
));
},
isVisible
:
function
()
{
return
this
.
$window
&&
this
.
$window
.
is
(
'
:visible
'
);
},
...
...
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