Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
c8742a62
Commit
c8742a62
authored
Dec 02, 2014
by
ThorbenQuast
Browse files
prevent x-overflow of dragbar which might have occured when the editor
view is split on two screens
parent
257094fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
vispa/extensions/codeeditor/static/js/ui.js
View file @
c8742a62
...
...
@@ -8,6 +8,7 @@ var CodeEditorUI = Emitter.extend({
this
.
xDragbar
=
null
;
this
.
yDragbar
=
null
;
this
.
oldXDragPosition
=
null
;
this
.
oldYDragPosition
=
null
;
},
...
...
@@ -29,9 +30,18 @@ var CodeEditorUI = Emitter.extend({
});
this
.
xDragbar
.
draggable
({
axis
:
"
x
"
,
start
:
function
(
event
,
ui
)
{
self
.
oldXDragPosition
=
self
.
xDragbar
.
css
(
"
left
"
);
},
stop
:
function
(
event
,
ui
)
{
var
width
=
$
(
self
.
view
.
_nodes
.
content
).
width
();
var
r
=
100.0
*
(
event
.
pageX
)
/
width
;
//prevent overflow if event.pageX > width
//which might be the case if editor is shown on two screens
if
(
r
>
100.0
)
{
self
.
xDragbar
.
css
(
"
left
"
,
self
.
oldXDragPosition
);
return
;
}
self
.
setInputOutputRatio
(
r
);
self
.
view
.
setPreference
(
"
inputOutputRatio
"
,
r
);
}
...
...
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