Commit 4a261888 authored by Nigel McNie's avatar Nigel McNie
Browse files

Make the new views interface work in ie7. It suffers from the same z-index...

Make the new views interface work in ie7. It suffers from the same z-index problem that firefox does, but at least now it works
parent 0de88299
...@@ -492,15 +492,32 @@ function ViewManager() { ...@@ -492,15 +492,32 @@ function ViewManager() {
// moved back into place // moved back into place
makePositioned(i); makePositioned(i);
var clone = DIV({'class': 'blocktype-clone'}); var clone = DIV({'class': 'blocktype-clone'});
// The border rule is required for IE7 to behave - and it needs the
// semi-colon!
setStyle(clone, { setStyle(clone, {
//'outline': '3px dotted #ccc;', 'border': '0px dotted transparent;',
'position': 'absolute' 'position': 'absolute'
}); });
setElementPosition(clone, getElementPosition(i, 'top-pane'));
setElementDimensions(clone, getElementDimensions(i)); setElementDimensions(clone, getElementDimensions(i));
setOpacity(clone, 0.5);
if (self.isIE7) {
appendChildNodes(clone, i.cloneNode(true));
hideElement(i);
alert('is ie7');
}
else {
setElementPosition(clone, getElementPosition(i, 'top-pane'));
setOpacity(clone, 0.5);
}
insertSiblingNodesAfter(i, clone); insertSiblingNodesAfter(i, clone);
// Prevents the height of the blocktype list doubling when dragging
if (self.isIE7) {
i.style.position = 'absolute';
}
new Draggable(clone, { new Draggable(clone, {
'starteffect': function () { 'starteffect': function () {
self.movingBlockType = true; self.movingBlockType = true;
...@@ -517,14 +534,29 @@ function ViewManager() { ...@@ -517,14 +534,29 @@ function ViewManager() {
// Make it a ghost. Done when starting the drag because // Make it a ghost. Done when starting the drag because
// some browsers have trouble rendering things right on top // some browsers have trouble rendering things right on top
// of one another // of one another
appendChildNodes(clone, i.cloneNode(true)); if (self.isIE7) {
showElement(i);
setOpacity(clone, 0.5);
}
else {
appendChildNodes(clone, i.cloneNode(true));
}
}, },
'revert': true, 'revert': true,
'reverteffect': function (innerelement, top_offset, left_offset) { 'reverteffect': function (innerelement, top_offset, left_offset) {
// The actual draggable is the clone we were dragging if (self.isIE7) {
// around, we can put it back and remove the clone now // Move the clone back and hide the filler used while
replaceChildNodes(clone); // dragging
setElementPosition(clone, getElementPosition(i, 'top-pane')); setElementPosition(clone, {x: 0, y: 0});
hideElement(i);
setOpacity(clone, 1);
}
else {
// The actual draggable is the clone we were dragging
// around, we can put it back and remove the clone now
replaceChildNodes(clone);
setElementPosition(clone, getElementPosition(i, 'top-pane'));
}
self.destroyHotzones(); self.destroyHotzones();
...@@ -887,6 +919,9 @@ function ViewManager() { ...@@ -887,6 +919,9 @@ function ViewManager() {
// The bottom pane - set in self.init // The bottom pane - set in self.init
this.bottomPane = null; this.bottomPane = null;
// Whether the browser is IE7 - needed for some hacks
this.isIE7 = document.all && document.documentElement && typeof(document.documentElement.style.maxHeight) != "undefined" && !window.opera;
addLoadEvent(self.init); addLoadEvent(self.init);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment