summaryrefslogtreecommitdiffstats
path: root/afb-client/bower_components/tether/js/abutment.js
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2016-02-09 18:40:49 +0100
committerFulup Ar Foll <fulup@iot.bzh>2016-02-09 18:40:49 +0100
commit3d2fda7dd39e2363682f1fa353c951ab0d44ddfa (patch)
treeaf968a8ac5d4fde1f3cebcec5fb0973eb2bfb2cb /afb-client/bower_components/tether/js/abutment.js
parent12a3520ba440316c76b95d92a684666f03f7b47d (diff)
Implemented URL query parsing for initial token /opa/?token=abcde
Diffstat (limited to 'afb-client/bower_components/tether/js/abutment.js')
-rw-r--r--afb-client/bower_components/tether/js/abutment.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/afb-client/bower_components/tether/js/abutment.js b/afb-client/bower_components/tether/js/abutment.js
new file mode 100644
index 0000000..b3acaa0
--- /dev/null
+++ b/afb-client/bower_components/tether/js/abutment.js
@@ -0,0 +1,59 @@
+(function() {
+ var defer, getBounds, updateClasses, _ref;
+
+ _ref = this.Tether.Utils, getBounds = _ref.getBounds, updateClasses = _ref.updateClasses, defer = _ref.defer;
+
+ this.Tether.modules.push({
+ position: function(_arg) {
+ var abutted, addClasses, allClasses, bottom, height, left, right, side, sides, targetPos, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5,
+ _this = this;
+ top = _arg.top, left = _arg.left;
+ _ref1 = this.cache('element-bounds', function() {
+ return getBounds(_this.element);
+ }), height = _ref1.height, width = _ref1.width;
+ targetPos = this.getTargetBounds();
+ bottom = top + height;
+ right = left + width;
+ abutted = [];
+ if (top <= targetPos.bottom && bottom >= targetPos.top) {
+ _ref2 = ['left', 'right'];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ side = _ref2[_i];
+ if ((_ref3 = targetPos[side]) === left || _ref3 === right) {
+ abutted.push(side);
+ }
+ }
+ }
+ if (left <= targetPos.right && right >= targetPos.left) {
+ _ref4 = ['top', 'bottom'];
+ for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
+ side = _ref4[_j];
+ if ((_ref5 = targetPos[side]) === top || _ref5 === bottom) {
+ abutted.push(side);
+ }
+ }
+ }
+ allClasses = [];
+ addClasses = [];
+ sides = ['left', 'top', 'right', 'bottom'];
+ allClasses.push(this.getClass('abutted'));
+ for (_k = 0, _len2 = sides.length; _k < _len2; _k++) {
+ side = sides[_k];
+ allClasses.push("" + (this.getClass('abutted')) + "-" + side);
+ }
+ if (abutted.length) {
+ addClasses.push(this.getClass('abutted'));
+ }
+ for (_l = 0, _len3 = abutted.length; _l < _len3; _l++) {
+ side = abutted[_l];
+ addClasses.push("" + (this.getClass('abutted')) + "-" + side);
+ }
+ defer(function() {
+ updateClasses(_this.target, addClasses, allClasses);
+ return updateClasses(_this.element, addClasses, allClasses);
+ });
+ return true;
+ }
+ });
+
+}).call(this);