diff --git a/package.json b/package.json index b02dfe2..101c85f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cssarrowplease", - "version": "0.2.2-10", + "version": "0.2.2-13", "author": { "name": "Simon HĂžjberg", "email": "r.hackr@gmail.com" diff --git a/public/js/lib/models/arrow.js b/public/js/lib/models/arrow.js index 262db02..dbe05d7 100644 --- a/public/js/lib/models/arrow.js +++ b/public/js/lib/models/arrow.js @@ -106,23 +106,32 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {}; var pos = this.get('position'), iPos = this.invertedPosition(), rgbColor = this.hexToRGB(color), + adjustment= 0, css = ".arrow_box:"; layer = layer || 'after'; + if(layer === 'after' && pos === 'top') { + adjustment = 1; + } + css += layer + ' {\n'; css += '\tborder-color: rgba(' + rgbColor.join(', ') + ', 0);\n'; css += '\tborder-' + iPos + '-color: ' + color + ';\n'; - css += '\tborder-width: ' + size + 'px;\n'; + css += '\tborder-width: ' + (size + adjustment) + 'px;\n'; if (pos === 'top' || pos === 'bottom') { - css += '\tleft: 50%;\n\tmargin-left: -' + size + 'px;\n'; + css += '\tleft: 50%;\n\tmargin-left: -' + (size + adjustment) + 'px;\n'; } else { css += '\ttop: 50%;\n\tmargin-top: -' + size + 'px;\n'; } + if (adjustment) { + css += '\ttop: ' + (0 - ((size * 2) + 1)) + 'px;\n'; + } + css += '}'; return css;