settings : {
active_class: 'open',
+ 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(){}
},
style : function (dropdown, target, settings) {
var css = $.extend({position: 'absolute'},
- this.dirs[settings.align].call(dropdown, target, settings));
++
+ this.position(dropdown, target, settings));
dropdown.attr('style', '').css(css);
},
}
},
+
// Insert rule to style psuedo elements
- adjust_pip : function (pip_offset_base, p) {
- var sheet = Foundation.stylesheet;
+ adjust_pip : function (dropdown,target,settings,position) {
+ var sheet = Foundation.stylesheet,
+ pip_offset_base = 8;
- if (this.small()) {
- pip_offset_base += p.left - 8;
+ if (dropdown.hasClass(settings.mega_class)) {
+ pip_offset_base = position.left + (target.outerWidth()/2) - 8;
+ }
+ else if (this.small()) {
+ pip_offset_base += position.left - 8;
}
this.rule_idx = sheet.cssRules.length;