mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
+ fixed scoping issue that caused all tabs dropped in any group to return to a single group
+ fixed a bug causing tabs in the "new tabs" group to be huge
This commit is contained in:
parent
9650718be6
commit
b35293d149
@ -656,42 +656,46 @@ window.Group.prototype = iQ.extend(new Item(), new Subscribable(), {
|
||||
// The latter two must refer to the container of an <Item>.
|
||||
// options - An object with optional settings for this call. Currently the only one is dontArrange.
|
||||
remove: function(a, options) {
|
||||
var $el;
|
||||
var item;
|
||||
|
||||
if(a.isAnItem) {
|
||||
item = a;
|
||||
$el = iQ(item.container);
|
||||
} else {
|
||||
$el = iQ(a);
|
||||
item = Items.item($el);
|
||||
}
|
||||
|
||||
if(typeof(options) == 'undefined')
|
||||
options = {};
|
||||
|
||||
var index = iQ.inArray(item, this._children);
|
||||
if(index != -1)
|
||||
this._children.splice(index, 1);
|
||||
|
||||
item.setParent(null);
|
||||
item.removeClass("tabInGroup");
|
||||
item.removeClass("inNewTabGroup")
|
||||
item.removeClass("stacked");
|
||||
item.removeClass("stack-trayed");
|
||||
item.setRotation(0);
|
||||
item.setSize(item.defaultSize.x, item.defaultSize.y);
|
||||
|
||||
iQ($el.get(0)).droppable("enable");
|
||||
item.removeOnClose(this);
|
||||
|
||||
if(typeof(item.setResizable) == 'function')
|
||||
item.setResizable(true);
|
||||
|
||||
if(this._children.length == 0 && !this.locked.close && !this.getTitle() && !options.dontClose){
|
||||
this.close();
|
||||
} else if(!options.dontArrange) {
|
||||
this.arrange();
|
||||
try {
|
||||
var $el;
|
||||
var item;
|
||||
|
||||
if(a.isAnItem) {
|
||||
item = a;
|
||||
$el = iQ(item.container);
|
||||
} else {
|
||||
$el = iQ(a);
|
||||
item = Items.item($el);
|
||||
}
|
||||
|
||||
if(typeof(options) == 'undefined')
|
||||
options = {};
|
||||
|
||||
var index = iQ.inArray(item, this._children);
|
||||
if(index != -1)
|
||||
this._children.splice(index, 1);
|
||||
|
||||
item.setParent(null);
|
||||
item.removeClass("tabInGroup");
|
||||
item.removeClass("inNewTabGroup")
|
||||
item.removeClass("stacked");
|
||||
item.removeClass("stack-trayed");
|
||||
item.setRotation(0);
|
||||
item.setSize(item.defaultSize.x, item.defaultSize.y);
|
||||
|
||||
iQ($el.get(0)).droppable("enable");
|
||||
item.removeOnClose(this);
|
||||
|
||||
if(typeof(item.setResizable) == 'function')
|
||||
item.setResizable(true);
|
||||
|
||||
if(this._children.length == 0 && !this.locked.close && !this.getTitle() && !options.dontClose){
|
||||
this.close();
|
||||
} else if(!options.dontArrange) {
|
||||
this.arrange();
|
||||
}
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -58,47 +58,13 @@ window.Item = function() {
|
||||
// Used by unsquish.
|
||||
this.userSize = null;
|
||||
|
||||
this.dragOptions = {
|
||||
cancelClass: 'close',
|
||||
start: function(e, ui) {
|
||||
drag.info = new Drag(this, e);
|
||||
},
|
||||
drag: function(e, ui) {
|
||||
drag.info.drag(e, ui);
|
||||
},
|
||||
stop: function() {
|
||||
drag.info.stop();
|
||||
drag.info = null;
|
||||
}
|
||||
};
|
||||
// Variable: dragOptions
|
||||
// Used to pass into iQ.fn.draggable
|
||||
this.dragOptions = null;
|
||||
|
||||
this.dropOptions = {
|
||||
over: function(){},
|
||||
out: function(){
|
||||
var group = drag.info.item.parent;
|
||||
if(group) {
|
||||
group.remove(drag.info.$el, {dontClose: true});
|
||||
}
|
||||
|
||||
iQ(this).removeClass("acceptsDrop");
|
||||
},
|
||||
drop: function(event){
|
||||
iQ(this).removeClass("acceptsDrop");
|
||||
},
|
||||
// Function: dropAcceptFunction
|
||||
// Given a DOM element, returns true if it should accept tabs being dropped on it.
|
||||
// Private to this file.
|
||||
accept: function dropAcceptFunction(el) {
|
||||
var $el = iQ(el);
|
||||
if($el.hasClass('tab')) {
|
||||
var item = Items.item($el);
|
||||
if(item && (!item.parent || !item.parent.expanded)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
// Variable: dropOptions
|
||||
// Used to pass into iQ.fn.droppable
|
||||
this.dropOptions = null;
|
||||
};
|
||||
|
||||
window.Item.prototype = {
|
||||
@ -136,6 +102,50 @@ window.Item.prototype = {
|
||||
Utils.assert('reloadBounds must set up this.bounds', this.bounds);
|
||||
|
||||
iQ(this.container).data('item', this);
|
||||
|
||||
// ___ drag
|
||||
this.dragOptions = {
|
||||
cancelClass: 'close',
|
||||
start: function(e, ui) {
|
||||
drag.info = new Drag(this, e);
|
||||
},
|
||||
drag: function(e, ui) {
|
||||
drag.info.drag(e, ui);
|
||||
},
|
||||
stop: function() {
|
||||
drag.info.stop();
|
||||
drag.info = null;
|
||||
}
|
||||
};
|
||||
|
||||
// ___ drop
|
||||
this.dropOptions = {
|
||||
over: function(){},
|
||||
out: function(){
|
||||
var group = drag.info.item.parent;
|
||||
if(group) {
|
||||
group.remove(drag.info.$el, {dontClose: true});
|
||||
}
|
||||
|
||||
iQ(this).removeClass("acceptsDrop");
|
||||
},
|
||||
drop: function(event){
|
||||
iQ(this).removeClass("acceptsDrop");
|
||||
},
|
||||
// Function: dropAcceptFunction
|
||||
// Given a DOM element, returns true if it should accept tabs being dropped on it.
|
||||
// Private to this file.
|
||||
accept: function dropAcceptFunction(el) {
|
||||
var $el = iQ(el);
|
||||
if($el.hasClass('tab')) {
|
||||
var item = Items.item($el);
|
||||
if(item && (!item.parent || !item.parent.expanded)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
// ----------
|
||||
@ -560,7 +570,7 @@ window.Items = {
|
||||
figure();
|
||||
}
|
||||
|
||||
if(rows == 1 && columns == 1) {
|
||||
if(rows == 1) {
|
||||
var maxWidth = Math.max(TabItems.tabWidth, bounds.width / 2);
|
||||
tabWidth = Math.min(Math.min(maxWidth, bounds.width / count), bounds.height / tabAspect);
|
||||
tabHeight = tabWidth * tabAspect;
|
||||
|
Loading…
Reference in New Issue
Block a user