Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Add -pie-track-active:false flag to prevent toggling the active class…
Browse files Browse the repository at this point in the history
… 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
lojjic committed Mar 28, 2012
1 parent 4b397f2 commit 29edda0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sources/Element.js
Expand Up @@ -4,6 +4,7 @@ PIE.Element = (function() {
var wrappers = {}, var wrappers = {},
lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init', lazyInitCssProp = PIE.CSS_PREFIX + 'lazy-init',
pollCssProp = PIE.CSS_PREFIX + 'poll', pollCssProp = PIE.CSS_PREFIX + 'poll',
trackActiveCssProp = PIE.CSS_PREFIX + 'track-active',
hoverClass = PIE.CLASS_PREFIX + 'hover', hoverClass = PIE.CLASS_PREFIX + 'hover',
activeClass = PIE.CLASS_PREFIX + 'active', activeClass = PIE.CLASS_PREFIX + 'active',
focusClass = PIE.CLASS_PREFIX + 'focus', focusClass = PIE.CLASS_PREFIX + 'focus',
Expand Down Expand Up @@ -76,6 +77,7 @@ PIE.Element = (function() {
ieDocMode = PIE.ieDocMode, ieDocMode = PIE.ieDocMode,
cs = el.currentStyle, cs = el.currentStyle,
lazy = cs.getAttribute( lazyInitCssProp ) === 'true', lazy = cs.getAttribute( lazyInitCssProp ) === 'true',
trackActive = cs.getAttribute( trackActiveCssProp ) !== 'false',
childRenderers; childRenderers;


// Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll // Polling for size/position changes: default to on in IE8, off otherwise, overridable by -pie-poll
Expand Down Expand Up @@ -180,7 +182,9 @@ PIE.Element = (function() {
addListener( el, 'onpropertychange', propChanged ); addListener( el, 'onpropertychange', propChanged );
addListener( el, 'onmouseenter', mouseEntered ); addListener( el, 'onmouseenter', mouseEntered );
addListener( el, 'onmouseleave', mouseLeft ); addListener( el, 'onmouseleave', mouseLeft );
addListener( el, 'onmousedown', mousePressed ); if( trackActive ) {
addListener( el, 'onmousedown', mousePressed );
}
if( el.tagName in PIE.focusableElements ) { if( el.tagName in PIE.focusableElements ) {
addListener( el, 'onfocus', focused ); addListener( el, 'onfocus', focused );
addListener( el, 'onblur', blurred ); addListener( el, 'onblur', blurred );
Expand Down
29 changes: 29 additions & 0 deletions 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 29edda0

Please sign in to comment.