mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
+ Updated Utils logging to deal gracefully with object properties you can't access (for permissions reasons, for instance)
+ Added storage.js… starting serialization + Disabled autoscroll on drag; the window should be locked down now + Fixed Aza's "cute little bug"; small tabs used to scoot up and left
This commit is contained in:
parent
dc891cb0ec
commit
c1fc86ad42
@ -436,6 +436,7 @@ window.Group.prototype = $.extend(new Item(), new Subscribable(), {
|
||||
|
||||
if(!this.locked) {
|
||||
$(container).draggable({
|
||||
scroll: false,
|
||||
start: function(){
|
||||
drag.info = new DragInfo(this);
|
||||
},
|
||||
@ -545,6 +546,7 @@ window.Groups = {
|
||||
|
||||
// ----------
|
||||
dragOptions: {
|
||||
scroll: false,
|
||||
start: function(e, ui) {
|
||||
drag.info = new DragInfo(this);
|
||||
},
|
||||
|
@ -317,8 +317,9 @@ window.Item.prototype = {
|
||||
}
|
||||
});
|
||||
|
||||
if(!blocked)
|
||||
if(!blocked) {
|
||||
data.bounds = newBounds;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
14
browser/base/content/tabcandy/app/storage.js
Normal file
14
browser/base/content/tabcandy/app/storage.js
Normal file
@ -0,0 +1,14 @@
|
||||
// ##########
|
||||
Storage = {
|
||||
init: function() {
|
||||
var file = Components.classes["@mozilla.org/file/directory_service;1"].
|
||||
getService(Components.interfaces.nsIProperties).
|
||||
get("ProfD", Components.interfaces.nsIFile);
|
||||
|
||||
/* var dir = Utils.getInstallDirectory('tabcandy@aza.raskin'); */
|
||||
Utils.log(file);
|
||||
}
|
||||
};
|
||||
|
||||
Storage.init();
|
||||
|
@ -7,9 +7,27 @@ window.TabItem = function(container, tab) {
|
||||
};
|
||||
|
||||
window.TabItem.prototype = $.extend(new Item(), {
|
||||
// ----------
|
||||
_getSizeExtra: function() {
|
||||
var $container = $(this.container);
|
||||
|
||||
var widthExtra = parseInt($container.css('padding-left'))
|
||||
+ parseInt($container.css('padding-right'));
|
||||
|
||||
var heightExtra = parseInt($container.css('padding-top'))
|
||||
+ parseInt($container.css('padding-bottom'));
|
||||
|
||||
return new Point(widthExtra, heightExtra);
|
||||
},
|
||||
|
||||
// ----------
|
||||
reloadBounds: function() {
|
||||
this.bounds = Utils.getBounds(this.container);
|
||||
|
||||
var extra = this._getSizeExtra();
|
||||
this.bounds.width += extra.x;
|
||||
this.bounds.height += extra.y;
|
||||
|
||||
this._updateDebugBounds();
|
||||
},
|
||||
|
||||
@ -19,6 +37,7 @@ window.TabItem.prototype = $.extend(new Item(), {
|
||||
var $title = $('.tab-title', $container);
|
||||
var $thumb = $('.thumb', $container);
|
||||
var $close = $('.close', $container);
|
||||
var extra = this._getSizeExtra();
|
||||
var css = {};
|
||||
|
||||
if(rect.left != this.bounds.left)
|
||||
@ -28,19 +47,13 @@ window.TabItem.prototype = $.extend(new Item(), {
|
||||
css.top = rect.top;
|
||||
|
||||
if(rect.width != this.bounds.width) {
|
||||
var widthExtra = parseInt($container.css('padding-left'))
|
||||
+ parseInt($container.css('padding-right'));
|
||||
|
||||
css.width = rect.width - widthExtra;
|
||||
css.width = rect.width - extra.x;
|
||||
var scale = css.width / TabItems.tabWidth;
|
||||
css.fontSize = TabItems.fontSize * scale;
|
||||
}
|
||||
|
||||
if(rect.height != this.bounds.height) {
|
||||
var heightExtra = parseInt($container.css('padding-top'))
|
||||
+ parseInt($container.css('padding-bottom'));
|
||||
|
||||
css.height = rect.height - heightExtra;
|
||||
css.height = rect.height - extra.y;
|
||||
}
|
||||
|
||||
if($.isEmptyObject(css))
|
||||
|
@ -226,7 +226,7 @@ var Utils = {
|
||||
|
||||
// ___ Files
|
||||
getInstallDirectory: function(id) {
|
||||
var file = extensionManager.getInstallLocation(id).getItemFile(id, "install.rdf");
|
||||
var file = extensionManager.getInstallLocation(id).getItemFile(id, "install.rdf");
|
||||
return file.parent;
|
||||
},
|
||||
|
||||
@ -327,7 +327,13 @@ var Utils = {
|
||||
expandObject: function(obj) {
|
||||
var s = obj + ' = {';
|
||||
for(prop in obj) {
|
||||
var value = obj[prop];
|
||||
var value;
|
||||
try {
|
||||
value = obj[prop];
|
||||
} catch(e) {
|
||||
value = '[!!error retrieving property]';
|
||||
}
|
||||
|
||||
s += prop + ': ';
|
||||
if(typeof(value) == 'string')
|
||||
s += '\'' + value + '\'';
|
||||
|
@ -25,6 +25,7 @@
|
||||
<script type="text/javascript;version=1.8" src="../../js/optional/jquery.lint.js"></script>
|
||||
<script type="text/javascript;version=1.8" src="../../js/optional/jquery-ui.js"></script>
|
||||
<script type="text/javascript;version=1.8" src="../../js/core/utils.js"></script>
|
||||
<script type="text/javascript;version=1.8" src="js/storage.js"></script>
|
||||
<script type="text/javascript;version=1.8" src="../../js/core/toolbar-button.js"></script>
|
||||
<script type="text/javascript;version=1.8">
|
||||
Utils.log('it begins');
|
||||
|
Loading…
Reference in New Issue
Block a user