Comments (5)
I've fixed this issue changing mouseMoveHandler
code, please test-it with above code:
From bfc38051ba3eaca73a56ce5e4271c53d20a17e6d Mon Sep 17 00:00:00 2001
From: Filipe Costa <[email protected]>
Date: Mon, 1 Dec 2014 22:43:19 +0000
Subject: [PATCH] Fix #60 - Drag position is calculated incorrectly when parent
elements has margins/paddings and defined position.
---
src/ui-layout.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/ui-layout.js b/src/ui-layout.js
index cd2b0ca..a2f256d 100644
--- a/src/ui-layout.js
+++ b/src/ui-layout.js
@@ -108,10 +108,13 @@ angular.module('ui.layout', [])
};
ctrl.mouseMoveHandler = function(mouseEvent) {
- lastPos = mouseEvent[ctrl.sizeProperties.mouseProperty] ||
+ var lastMousePos = mouseEvent[ctrl.sizeProperties.mouseProperty] ||
(mouseEvent.originalEvent && mouseEvent.originalEvent[ctrl.sizeProperties.mouseProperty]) ||
(mouseEvent.targetTouches ? mouseEvent.targetTouches[0][ctrl.sizeProperties.mouseProperty] : 0);
+ var lastRelativePos = lastMousePos - $element.offset()[ctrl.sizeProperties.flowProperty];
+ lastPos = lastRelativePos;
+
//Cancel previous rAF call
if(animationFrameRequested) {
window.cancelAnimationFrame(animationFrameRequested);
--
1.9.4.msysgit.2
Thanks!
from ui-layout.
Just to clarify, $element.offset function is the jQuery offset function, but jQuery is not defined as a dependency, so this could be a problem.
from ui-layout.
I've provided a similar patch in #52 that does not require jQuery.
from ui-layout.
@nevcos can you confirm v1.0.5 fixes this issue? Thansk!
from ui-layout.
Hi @jbroquist, sorry about the (very) late response.
Successfully tested with master and version 1.0.5 👍
Thanks!
from ui-layout.
Related Issues (20)
- snap to edge support at reaching certain container size
- resizable parameter
- detecting pane size in pixel after resize HOT 1
- resize panel to contents
- Unable to stop splitter event
- disable animations HOT 1
- Odd problem trying to start ui-layout HOT 2
- Layout not rezized when parent size change HOT 2
- Ui-layout overlaps every other page element. Is not Bootstrap friendly HOT 1
- Horizontal movement of splitbar is not resizing contents HOT 1
- Main window resize
- How to disableToggle for individual splitbar? HOT 2
- splitbar can't stop moving by mousemove
- Add Version Number to source JS file
- Percent sized containers and toggle buttons with some browsers are broken HOT 1
- Percent min-size and max-size should be recalculated on resize
- CHANGELOG.md not up to date HOT 2
- Hiding and then showing the layout doesn't re-calculate offsets properly. HOT 2
- Toggle functionality not working properly
- Resizing doesn't work properly with an iframe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-layout.