mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
Resolves #429 eliminate clientWidth in favor of getBoundingClientRect
This commit is contained in:
parent
be3a565ccd
commit
97e6eef62f
3 changed files with 9 additions and 7 deletions
|
@ -301,9 +301,10 @@ var VisBranch = VisBase.extend({
|
|||
var textNode = this.get('text').node;
|
||||
if (this.get('isHead')) {
|
||||
// HEAD is a special case
|
||||
var size = textNode.getBoundingClientRect();
|
||||
return firefoxFix({
|
||||
w: textNode.clientWidth,
|
||||
h: textNode.clientHeight
|
||||
w: size.width,
|
||||
h: size.height
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ var VisTag = VisBase.extend({
|
|||
getTextSize: function() {
|
||||
var getTextWidth = function(visTag) {
|
||||
var textNode = (visTag.get('text')) ? visTag.get('text').node : null;
|
||||
return (textNode === null) ? 0 : textNode.clientWidth;
|
||||
return (textNode === null) ? 0 : textNode.getBoundingClientRect().width;
|
||||
};
|
||||
|
||||
var firefoxFix = function(obj) {
|
||||
|
@ -219,7 +219,7 @@ var VisTag = VisBase.extend({
|
|||
var name = this.get('tag').getName();
|
||||
var isRemote = this.getIsRemote();
|
||||
var isHg = this.gitEngine.getIsHg();
|
||||
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
|
@ -341,7 +341,7 @@ var VisTag = VisBase.extend({
|
|||
if (this.getIsGoalAndNotCompared()) {
|
||||
return this.get('stroke-width') / 5.0;
|
||||
}
|
||||
|
||||
|
||||
return this.get('stroke-width');
|
||||
},
|
||||
|
||||
|
|
|
@ -261,8 +261,9 @@ var Visualization = Backbone.View.extend({
|
|||
var smaller = 1;
|
||||
var el = this.el;
|
||||
|
||||
var width = el.clientWidth - smaller;
|
||||
var height = el.clientHeight - smaller;
|
||||
var elSize = el.getBoundingClientRect();
|
||||
var width = elSize.width - smaller;
|
||||
var height = elSize.height - smaller;
|
||||
|
||||
// if we don't have a container, we need to set our
|
||||
// position absolutely to whatever we are tracking
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue