Skip to content

Commit 682ac82

Browse files
committed
Fix a graphical bug in Firefox
1 parent 529f103 commit 682ac82

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

public/js/lib/models/arrow.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
3636
else if ( pos === 'right' ) return 'left';
3737
},
3838

39+
/**
40+
@method hexToRGB
41+
@description
42+
returns an rgb color from an hex color
43+
@returns {Array}
44+
**/
45+
hexToRGB: function (h) {
46+
var rgb = [],
47+
i = 1;
48+
49+
for(; i < 6; i+=2) {
50+
rgb.push(parseInt(h.substring(i, i + 2), 16));
51+
}
52+
return rgb;
53+
},
54+
3955
/**
4056
@method _baseCSS
4157
@description generates the base css
@@ -87,12 +103,14 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
87103
_arrowCSS: function (color, size, layer) {
88104
var pos = this.get('position'),
89105
iPos = this.invertedPosition(),
106+
rgbColor = this.hexToRGB(color),
90107
css = ".arrow_box:";
91108

92109
layer = layer || 'after';
93110

94111
css += layer + ' {\n';
95112

113+
css += '\tborder-color: rgba(' + rgbColor.join(', ') + ', 0);\n';
96114
css += '\tborder-' + iPos + '-color: ' + color + ';\n';
97115
css += '\tborder-width: ' + size + 'px;\n';
98116

0 commit comments

Comments
 (0)