Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Foundation build to bower-foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhayes committed Sep 12, 2014
1 parent 0f07eeb commit 131f0d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 92 deletions.
45 changes: 1 addition & 44 deletions js/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1620,13 +1620,6 @@
mega_class: 'mega',
align: 'bottom',
is_hover: false,
smart_position: true,
smart_position_arrays: {
right: ['right', 'bottom', 'top', 'left', 'right'],
left: ['left', 'right', 'bottom', 'top', 'left'],
top: ['top', 'right', 'bottom', 'left', 'top'],
bottom : ['bottom', 'top', 'right', 'left', 'bottom']
},
opened: function(){},
closed: function(){}
},
Expand Down Expand Up @@ -1816,45 +1809,10 @@

style : function (dropdown, target, settings) {
var css = $.extend({position: 'absolute'},

this.position(dropdown, target, settings));
this.dirs[settings.align].call(dropdown, target, settings));

dropdown.attr('style', '').css(css);
},
// return CSS property object
position: function(d, t, s) {
var res = {},
vp = {},
list = s.smart_position_arrays[s.align],
len = list.length,
dd_w = d.outerWidth(),
dd_h = d.outerHeight(),
o = d.offsetParent().offset();

if (s.smart_position) {
var $win = $(window);
vp.top = $win.scrollTop();
vp.left = $win.scrollLeft();
vp.right = vp.left + $win.width();
vp.bottom = vp.top + $win.height();

for (var i=0; i < len; i++) {
res = this.dirs[list[i]].call(d, t, s);
if (this.is_out(vp, res.top + o.top, res.left + o.left, dd_w, dd_h, 3) === false)
break;
}
}
else {
res = this.dirs[s.align].call(d, t, s);
}

return res;
},

is_out: function (vp, top, left, width, height, buffer) {
return (top < vp.top + buffer || left < vp.left + buffer
|| top + height > vp.bottom - buffer || left + width > vp.right - buffer);
},

// return CSS property object
// `this` is the dropdown
Expand Down Expand Up @@ -1917,7 +1875,6 @@
}
},


// Insert rule to style psuedo elements
adjust_pip : function (dropdown,target,settings,position) {
var sheet = Foundation.stylesheet,
Expand Down
Loading

0 comments on commit 131f0d2

Please sign in to comment.