Fixed sidepanel bug in Chrome/win

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1592 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Alexis Deveria
2010-06-09 18:17:58 +00:00
parent da474c6232
commit ae34bb90fb
2 changed files with 15 additions and 3 deletions

View File

@@ -23,6 +23,7 @@
#svg_editor #svgroot {
-moz-user-select: none;
-webkit-user-select: none;
position: absolute;
top: 0;
left: 0;
@@ -140,6 +141,9 @@
width: 0px;
overflow: auto;
margin: 0px;
-moz-user-select: none;
-webkit-user-select: none;
}
/*
@@ -162,6 +166,7 @@
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-user-select: none;
-webkit-user-select: none;
}
#svg_editor #sidepanel_handle:hover {
@@ -171,6 +176,7 @@
#svg_editor #sidepanel_handle * {
cursor: pointer;
-moz-user-select: none;
-webkit-user-select: none;
}
#svg_editor #layerbuttons {
margin: 0px;
@@ -768,6 +774,7 @@ span.zoom_tool {
#svg_editor .stroke_tool div div {
-moz-user-select: none;
-webkit-user-select: none;
width: 20px;
height: 20px;
margin: 1px 0;

View File

@@ -2940,13 +2940,14 @@
var SIDEPANEL_MAXWIDTH = 300;
var SIDEPANEL_OPENWIDTH = 150;
var sidedrag = -1, sidedragging = false;
var sidedrag = -1, sidedragging = false, allowmove = false;
var resizePanel = function(evt) {
if (!allowmove) return;
if (sidedrag == -1) return;
sidedragging = true;
var deltax = sidedrag - evt.pageX;
var sidepanels = $('#sidepanels');
var sidewidth = parseInt(sidepanels.css('width'));
if (sidewidth+deltax > SIDEPANEL_MAXWIDTH) {
@@ -2971,7 +2972,11 @@
.mousedown(function(evt) {
sidedrag = evt.pageX;
$(window).mousemove(resizePanel);
allowmove = false;
// Silly hack for Chrome, which always runs mousemove right after mousedown
setTimeout(function() {
allowmove = true;
}, 20);
})
.mouseup(function(evt) {
if (!sidedragging) toggleSidePanel();