forked from shipshapecode/tether
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nick Hwang
committed
Jun 17, 2015
1 parent
b5f7149
commit ea1f68b
Showing
16 changed files
with
89 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/*}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters