Commit c8742a62 authored by ThorbenQuast's avatar ThorbenQuast
Browse files

prevent x-overflow of dragbar which might have occured when the editor

view is split on two screens
parent 257094fc
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment