diff --git a/.hsdoc b/.hsdoc index 9e45e327..847df1dd 100644 --- a/.hsdoc +++ b/.hsdoc @@ -1,6 +1,6 @@ name: "Tether" description: "Marrying DOM elements for life" +domain: "tether.io" source: "coffee/*.coffee" examples: "**/*.md" -assets: "{deps/*,*.js,*.coffee,css/*.css,docs/css/*.css,docs/js/*,js,docs/welcome/*,examples/*}" -domain: "tether.io" +assets: "{dist/js/*.js,dist/css/*.css,docs/css/*.css,docs/js/*,js,docs/welcome/*,examples/*}" diff --git a/docs/intro.md b/docs/intro.md index 70c0a4b9..c1fd45fb 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1,5 +1,5 @@ - - + + diff --git a/docs/js/markAttachment.js b/docs/js/markAttachment.js new file mode 100644 index 00000000..c7d34f08 --- /dev/null +++ b/docs/js/markAttachment.js @@ -0,0 +1,51 @@ +/* globals Tether */ + +'use strict'; + +Tether.modules.push({ + initialize: function initialize() { + var _this = this; + + this.markers = {}; + + ['target', 'element'].forEach(function (type) { + var el = document.createElement('div'); + el.className = _this.getClass('' + type + '-marker'); + + var dot = document.createElement('div'); + dot.className = _this.getClass('marker-dot'); + el.appendChild(dot); + + _this[type].appendChild(el); + + _this.markers[type] = { dot: dot, el: el }; + }); + }, + + position: function position(_ref) { + var manualOffset = _ref.manualOffset; + var manualTargetOffset = _ref.manualTargetOffset; + + var offsets = { + element: manualOffset, + target: manualTargetOffset + }; + + for (var type in offsets) { + var offset = offsets[type]; + for (var side in offset) { + var val = offset[side]; + var notString = typeof val !== 'string'; + if (notString || val.indexOf('%') === -1 && val.indexOf('px') === -1) { + val += 'px'; + } + + if (this.markers[type].dot.style[side] !== val) { + this.markers[type].dot.style[side] = val; + } + } + } + + return true; + } +}); diff --git a/docs/welcome/browser-demo.html b/docs/welcome/browser-demo.html index 4915b778..f6fdea41 100644 --- a/docs/welcome/browser-demo.html +++ b/docs/welcome/browser-demo.html @@ -10,10 +10,10 @@ - + - +