Browse files

Add -pie-track-active:false flag to prevent toggling the active class…

… name on mousedown/up on a case by case basis. This can be used to avoid the IE6-7 bug where you couldn't drag the scrollbar of a descendant. Fixes issue #190.
  • Loading branch information...
1 parent 0aa983e commit ad253e865885998a106216d8aa7437f43b754a4a @lojjic committed Mar 27, 2012
Showing with 34 additions and 1 deletion.
  1. +5 −1 sources/Element.js
  2. +29 −0 tests/submitted/issue190.html
View
6 sources/Element.js
@@ -4,6 +4,7 @@ PIE.Element = (function() {
var wrappers = {},
lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init',
pollCssProp = PIE.CSS_PREFIX + 'poll',
+ trackActiveCssProp = PIE.CSS_PREFIX + 'track-active',
hoverClass = PIE.CLASS_PREFIX + 'hover',
activeClass = PIE.CLASS_PREFIX + 'active',
focusClass = PIE.CLASS_PREFIX + 'focus',
@@ -73,6 +74,7 @@ PIE.Element = (function() {
ieDocMode = PIE.ieDocMode,
cs = el.currentStyle,
lazy = cs.getAttribute( lazyInitCssProp ) === 'true',
+ trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false',
childRenderers;
// Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll
@@ -172,7 +174,9 @@ PIE.Element = (function() {
addListener( el, 'onpropertychange', propChanged );
addListener( el, 'onmouseenter', mouseEntered );
addListener( el, 'onmouseleave', mouseLeft );
- addListener( el, 'onmousedown', mousePressed );
+ if( trackActive ) {
+ addListener( el, 'onmousedown', mousePressed );
+ }
if( el.tagName in PIE.focusableElements ) {
addListener( el, 'onfocus', focused );
addListener( el, 'onblur', blurred );
View
29 tests/submitted/issue190.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title></title>
+
+ <style type="text/css">
+ .cssPieRoundedCornersTest
+ {
+ border: 1px solid #000;
+ border-radius: 10px;
+ behavior: url(../../build/PIE.htc);
+ position: relative;
+ -pie-track-active: false;
+ }
+ </style>
+
+</head>
+<body>
+
+<div class="cssPieRoundedCornersTest" style="height:150px;">
+ <div style="overflow:auto; height:75px; width:50%;">
+ Hello 1<br/>Hello 2<br/>Hello 3<br/>Hello 4<br/>Hello 5<br/>Hello 6<br/>
+ Hello 7<br/>Hello 8<br/>Hello 9<br/>Hello 10<br/>Hello 11<br/>Hello 12<br/>
+ Hello 13<br/>Hello 14<br/>Hello 15<br/>Hello 16<br/>Hello 17<br/>Hello 18<br/>
+ </div>
+</div>
+
+</body>
+</html>

0 comments on commit ad253e8

Please sign in to comment.