Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix IE10/11 problems (close #318), plus IE8 problems. Fix close modal…
Browse files Browse the repository at this point in the history
… by ESC key that was broken.
  • Loading branch information
cdujeu committed Oct 19, 2013
1 parent 8a5404f commit 5077cfd
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 23 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

Expand Up @@ -512,11 +512,15 @@ Class.create("AjxpTabulator", AjxpPane, {

clearState: function(){
this.tabulatorData.each(function(tabInfo){
var ajxpObject = this.getAndSetAjxpObject(tabInfo);
if(ajxpObject.clearStateData){
ajxpObject.clearStateData();
try{
var ajxpObject = this.getAndSetAjxpObject(tabInfo);
if(ajxpObject.clearStateData){
ajxpObject.clearStateData();
}
this.closeTab(tabInfo.id, true);
}catch(e){

}
this.closeTab(tabInfo.id, true);
}.bind(this));
}

Expand Down
22 changes: 16 additions & 6 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.FilesList.js
Expand Up @@ -1198,12 +1198,22 @@ Class.create("FilesList", SelectableElements, {
}
}
item.ajxpNode = null;
new Effect.Fade(item, {afterFinish:function(){
try{item.remove();}catch(e){}
delete item;
this.initRowsBuffered();
//this.initRows();
}.bind(this), duration:0.2});
if(Prototype.Browser.IE && Prototype.Version.startsWith('1.6')){
window.setTimeout(function(){
item.remove();
delete item;
this.initRowsBuffered();
}.bind(this), 10);
}else{
new Effect.Fade(item, {afterFinish:function(){
try{
item.remove();
}catch(e){if(console) console.log(e);}
delete item;
this.initRowsBuffered();
}.bind(this), duration:0.2});

}
/*
item.remove();
delete item;
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer_boot.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion core/src/plugins/gui.ajax/res/js/lib/leightbox/lightbox.js
Expand Up @@ -205,7 +205,9 @@ function initialize(){
//modal.close();
if(modal.currentLightBoxElement){
removeLightboxFromElement(modal.currentLightBoxElement);
modal.currentLightBoxModal.remove();
if(modal.currentLightBoxModal) {
modal.currentLightBoxModal.remove();
}
modal.currentLightBoxElement = null;
modal.currentLightBoxModal = null;
}else{
Expand Down
Expand Up @@ -16,6 +16,7 @@ var Prototype = {
return {
IE: !!window.attachEvent && !isOpera,
IE10: ua.indexOf('MSIE 10') > -1,
IE10plus: ua.indexOf('MSIE 10') > -1 || ua.indexOf('MSIE 11') > -1 || ua.indexOf('MSIE 12') > -1 || ua.indexOf('MSIE 13') > -1,
Opera: isOpera,
WebKit: ua.indexOf('AppleWebKit/') > -1,
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
Expand Down
27 changes: 24 additions & 3 deletions core/src/plugins/gui.ajax/res/js/lib/prototype/webfx.selectable.js
Expand Up @@ -351,7 +351,7 @@ SelectableElements = Class.create({
if(!this._fireChange)
return;
if(typeof this.ondblclick == "string" && this.ondblclick != "")
this.ondblclick = new Funtion(this.ondblclick);
this.ondblclick = new Function(this.ondblclick);
if(typeof this.ondblclick == "function")
this.ondblclick();
},
Expand All @@ -360,12 +360,33 @@ SelectableElements = Class.create({
//alert('Dbl Click!');
this.fireDblClick();
},

previousEventTime: null,
previousEventTarget: null,
ie10detailFilter : function(e){
if(!Prototype.Browser.IE10plus){
return true;
}
var result = true;
if(!this.previousEventTime){
result = false;
}
if(e.timeStamp - this.previousEventTime > 300 && e.target != this.previousEventTarget){
result = false;
}
this.previousEventTarget = e.target;
this.previousEventTime = e.timeStamp;
return result;
},

click: function (e) {
if(e.detail && e.detail > 1)
{
this.fireDblClick();
{
if(this.ie10detailFilter(e)){
this.fireDblClick();
}
}

var oldFireChange = this._fireChange;
this._fireChange = false;

Expand Down
10 changes: 7 additions & 3 deletions core/src/plugins/gui.ajax/res/js/lib/scriptaculous/src/slider.js
Expand Up @@ -139,9 +139,13 @@ Control.Slider = Class.create({
this.values[handleIdx] = sliderValue;
this.value = this.values[0]; // assure backwards compat

this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] =
this.translateToPx(sliderValue);

//this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue);
if(handleIdx && this.handles[handleIdx]){
var style = {};
style[this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue);
this.handles[handleIdx].setStyle(style);
}

this.drawSpans();
if (!this.dragging || !this.event) this.updateFinished();
},
Expand Down
8 changes: 4 additions & 4 deletions core/src/plugins/gui.ajax/res/js/lib/webfx/xtree.js
Expand Up @@ -306,9 +306,9 @@ WebFXTreeAbstractNode.prototype.toggle = function() {

WebFXTreeAbstractNode.prototype.select = function() {
if($(this.id + '-anchor')) {
$(this.id + '-anchor').focus();
webFXTreeHandler.focus(this);
try{
$(this.id + '-anchor').focus();
webFXTreeHandler.focus(this);
if(!this.scrollContainer){
var root = this;
while (root.parentNode) { root = root.parentNode; }
Expand Down Expand Up @@ -494,7 +494,7 @@ WebFXTree.prototype.expand = function() {
} ;

WebFXTree.prototype.collapse = function(b) {
if (!b) { this.focus(); }
if (!b) { try{this.focus();}catch(e){} }
this.doCollapse();
} ;

Expand Down Expand Up @@ -640,7 +640,7 @@ WebFXTreeItem.prototype.expand = function() {
};

WebFXTreeItem.prototype.collapse = function(b) {
if (!b) { this.focus(); }
if (!b) { try{this.focus();}catch(e){} }
this.doCollapse();
if($(this.id + '-plus')) $(this.id + '-plus').src = this.plusIcon;
};
Expand Down

0 comments on commit 5077cfd

Please sign in to comment.