Permalink
Browse files

added pointer events hook when overlay is locked

  • Loading branch information...
1 parent d9df008 commit 067908af67d8f250ff4eaa4f08dafbcb322cfad8 Mike Buckley committed Nov 6, 2011
View
3 .gitignore
@@ -1,2 +1,3 @@
.project
-.DS_Store
+.DS_Store
+pixel-perfect.sublime-workspace
View
BIN dist/pixelperfect-1.7.1.xpi
Binary file not shown.
View
2 packageExtension.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# generate the XPI file
# TODO: Pass in version as parameter
-VERSION=1.7.0
+VERSION=1.7.1
echo "Generating $APP_NAME.xpi..."
cd srcExtension
zip -r ../dist/pixelperfect-$VERSION.xpi *
View
8 pixel-perfect.sublime-project
@@ -0,0 +1,8 @@
+{
+ "folders":
+ [
+ {
+ "path": "/Users/mbuckley/projects/ohc/PixelPerfect"
+ }
+ ]
+}
View
28 srcExtension/chrome/pixelperfect/content/panelActions.js
@@ -1,5 +1,4 @@
-var pixelPerfect = pixelPerfect ||
-{};
+var pixelPerfect = pixelPerfect || {};
if (typeof pixelPerfect.panelActions == "undefined") {
pixelPerfect.panelActions = {};
@@ -146,14 +145,7 @@ pixelPerfect.panelActions = function(){
var zIndexTextInputEle = document.getElementById('z-index-input');
var savedZIndex = this.getPref("pixelPerfect.zIndex");
zIndexTextInputEle.value = savedZIndex;
-
- // update overlayLocked Attribute from pref
- var overlayLockedChkEle = document.getElementById('position-lock-chk');
- overlayLocked = this.getPref("pixelPerfect.overlayLocked");
- this.updateDragStatus();
- overlayLockedChkEle.checked = overlayLocked;
-
- // update locked status from pref
+
imageDimensions = this.getImageDimensions(chromeToOverlayUrl);
var width = imageDimensions[0];
@@ -168,14 +160,21 @@ pixelPerfect.panelActions = function(){
divPixelPerfect.style.position = 'absolute';
divPixelPerfect.style.top = this.getPref("pixelPerfect.lastYPos") + 'px';
divPixelPerfect.style.left = this.getPref("pixelPerfect.lastXPos") + 'px';
- divPixelPerfect.style.cursor = 'all-scroll';
+ divPixelPerfect.style.cursor = 'all-scroll';
var draggableScriptId = "draggable-script";
var existingDraggableScript = x.document.getElementById(draggableScriptId);
this.removeChildElement(existingDraggableScript, pageBody);
pageBody.appendChild(divPixelPerfect);
+
+ // update overlayLocked Attribute from pref
+ var overlayLockedChkEle = document.getElementById('position-lock-chk');
+ overlayLocked = this.getPref("pixelPerfect.overlayLocked");
+ this.updateDragStatus();
+ this.togglePointerEvents();
+ overlayLockedChkEle.checked = overlayLocked;
// opacity
var savedOpacity = this.getPref("pixelPerfect.opacity");
@@ -317,6 +316,7 @@ pixelPerfect.panelActions = function(){
togglePositionLock: function(chkEle) {
overlayLocked = chkEle.checked;
this.updateDragStatus();
+ this.togglePointerEvents();
this.setPrefValue("pixelPerfect.overlayLocked", overlayLocked);
},
@@ -325,6 +325,12 @@ pixelPerfect.panelActions = function(){
ppOverlayEle.style.zIndex = zIndexInputEle.value;
this.setPrefValue("pixelPerfect.zIndex", zIndexInputEle.value);
},
+
+ togglePointerEvents: function () {
+ var pp_overlay = x.document.getElementById(overlayDivId);
+ var pointerEventsVal = (overlayLocked) ? 'none' : 'auto';
+ pp_overlay.style.pointerEvents = pointerEventsVal;
+ },
updateDragStatus: function() {
var pageBody = x.document.getElementsByTagName("body")[0];
View
2 srcExtension/install.rdf
@@ -6,7 +6,7 @@
<em:iconURL>chrome://pixelperfect/content/images/logo_32x32.png</em:iconURL>
<em:homepageURL>http://www.pixelperfectplugin.com/</em:homepageURL>
<em:id>pixelperfectplugin@openhouseconcepts.com</em:id>
- <em:version>1.7.0</em:version>
+ <em:version>1.7.1</em:version>
<em:type>2</em:type>
<em:unpack>true</em:unpack>
<em:targetApplication>

0 comments on commit 067908a

Please sign in to comment.