mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-14 16:44:26 +02:00
firefox support
This commit is contained in:
parent
003977911d
commit
eed87168ed
7 changed files with 160 additions and 33 deletions
|
@ -201,16 +201,22 @@ var VisBranch = VisBase.extend({
|
|||
getTextSize: function() {
|
||||
var getTextWidth = function(visBranch) {
|
||||
var textNode = visBranch.get('text').node;
|
||||
return (textNode === null) ? 1 : textNode.clientWidth;
|
||||
return (textNode === null) ? 0 : textNode.clientWidth;
|
||||
};
|
||||
|
||||
var firefoxFix = function(obj) {
|
||||
if (!obj.w) { obj.w = 75; }
|
||||
if (!obj.h) { obj.h = 20; }
|
||||
return obj;
|
||||
};
|
||||
|
||||
var textNode = this.get('text').node;
|
||||
if (this.get('isHead')) {
|
||||
// HEAD is a special case
|
||||
return {
|
||||
return firefoxFix({
|
||||
w: textNode.clientWidth,
|
||||
h: textNode.clientHeight
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
var maxWidth = 0;
|
||||
|
@ -219,11 +225,12 @@ var VisBranch = VisBase.extend({
|
|||
branch.obj.get('visBranch')
|
||||
));
|
||||
});
|
||||
console.log('getting text size', textNode, 'width', textNode.clientWidth);
|
||||
|
||||
return {
|
||||
return firefoxFix({
|
||||
w: maxWidth,
|
||||
h: textNode.clientHeight
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
getSingleRectSize: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue