Update JSON API
[src/app-framework-demo.git] / afm-client / bower_components / tether / js / shift.js
1 (function() {
2   this.Tether.modules.push({
3     position: function(_arg) {
4       var left, result, shift, shiftLeft, shiftTop, top, _ref;
5       top = _arg.top, left = _arg.left;
6       if (!this.options.shift) {
7         return;
8       }
9       result = function(val) {
10         if (typeof val === 'function') {
11           return val.call(this, {
12             top: top,
13             left: left
14           });
15         } else {
16           return val;
17         }
18       };
19       shift = result(this.options.shift);
20       if (typeof shift === 'string') {
21         shift = shift.split(' ');
22         shift[1] || (shift[1] = shift[0]);
23         shiftTop = shift[0], shiftLeft = shift[1];
24         shiftTop = parseFloat(shiftTop, 10);
25         shiftLeft = parseFloat(shiftLeft, 10);
26       } else {
27         _ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1];
28       }
29       top += shiftTop;
30       left += shiftLeft;
31       return {
32         top: top,
33         left: left
34       };
35     }
36   });
37
38 }).call(this);