summaryrefslogtreecommitdiffstats
path: root/afb-client/bower_components/tether/js/shift.js
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2016-05-31 18:16:48 +0200
committerStephane Desneux <stephane.desneux@iot.bzh>2016-05-31 18:16:48 +0200
commit5b1e6cc132f44262a873fa8296a2a3e1017b0278 (patch)
tree43b2cd54e2e300b399ff3f2af4458a2c4ed8a144 /afb-client/bower_components/tether/js/shift.js
parentf7d2f9ac4168ee5064580c666d508667a73cefc0 (diff)
parent85ace9c1ce9a98e9b8a22f045c7dd752b38d9129 (diff)
Merge afb-client
Diffstat (limited to 'afb-client/bower_components/tether/js/shift.js')
-rw-r--r--afb-client/bower_components/tether/js/shift.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/afb-client/bower_components/tether/js/shift.js b/afb-client/bower_components/tether/js/shift.js
new file mode 100644
index 0000000..58b935f
--- /dev/null
+++ b/afb-client/bower_components/tether/js/shift.js
@@ -0,0 +1,38 @@
+(function() {
+ this.Tether.modules.push({
+ position: function(_arg) {
+ var left, result, shift, shiftLeft, shiftTop, top, _ref;
+ top = _arg.top, left = _arg.left;
+ if (!this.options.shift) {
+ return;
+ }
+ result = function(val) {
+ if (typeof val === 'function') {
+ return val.call(this, {
+ top: top,
+ left: left
+ });
+ } else {
+ return val;
+ }
+ };
+ shift = result(this.options.shift);
+ if (typeof shift === 'string') {
+ shift = shift.split(' ');
+ shift[1] || (shift[1] = shift[0]);
+ shiftTop = shift[0], shiftLeft = shift[1];
+ shiftTop = parseFloat(shiftTop, 10);
+ shiftLeft = parseFloat(shiftLeft, 10);
+ } else {
+ _ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1];
+ }
+ top += shiftTop;
+ left += shiftLeft;
+ return {
+ top: top,
+ left: left
+ };
+ }
+ });
+
+}).call(this);