|
@ -2334,14 +2334,14 @@ $.fn.checkbox = function(parameters) { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
disable: function() { |
|
|
|
|
|
|
|
|
enable: function() { |
|
|
module.debug('Enabling checkbox functionality'); |
|
|
module.debug('Enabling checkbox functionality'); |
|
|
$module.addClass(className.disabled); |
|
|
$module.addClass(className.disabled); |
|
|
$input.prop('disabled', false); |
|
|
$input.prop('disabled', false); |
|
|
$.proxy(settings.onDisabled, $input.get())(); |
|
|
$.proxy(settings.onDisabled, $input.get())(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
enable: function() { |
|
|
|
|
|
|
|
|
disable: function() { |
|
|
module.debug('Disabling checkbox functionality'); |
|
|
module.debug('Disabling checkbox functionality'); |
|
|
$module.removeClass(className.disabled); |
|
|
$module.removeClass(className.disabled); |
|
|
$input.prop('disabled', 'disabled'); |
|
|
$input.prop('disabled', 'disabled'); |
|
@ -3890,6 +3890,12 @@ $.fn.dropdown = function(parameters) { |
|
|
; |
|
|
; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
focusSearch: function() { |
|
|
|
|
|
$search |
|
|
|
|
|
.focus() |
|
|
|
|
|
; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
event: { |
|
|
event: { |
|
|
// prevents focus callback from occuring on mousedown
|
|
|
// prevents focus callback from occuring on mousedown
|
|
|
mousedown: function() { |
|
|
mousedown: function() { |
|
@ -3951,17 +3957,12 @@ $.fn.dropdown = function(parameters) { |
|
|
// close shortcuts
|
|
|
// close shortcuts
|
|
|
if(pressedKey == keys.escape) { |
|
|
if(pressedKey == keys.escape) { |
|
|
module.verbose('Escape key pressed, closing dropdown'); |
|
|
module.verbose('Escape key pressed, closing dropdown'); |
|
|
$search.blur(); |
|
|
|
|
|
module.hide(); |
|
|
module.hide(); |
|
|
} |
|
|
} |
|
|
// result shortcuts
|
|
|
// result shortcuts
|
|
|
if(module.is.visible()) { |
|
|
if(module.is.visible()) { |
|
|
if(pressedKey == keys.enter && hasSelectedItem) { |
|
|
if(pressedKey == keys.enter && hasSelectedItem) { |
|
|
module.verbose('Enter key pressed, choosing selected item'); |
|
|
module.verbose('Enter key pressed, choosing selected item'); |
|
|
if(module.is.searchable()) { |
|
|
|
|
|
module.verbose('Removing focus from search input'); |
|
|
|
|
|
$search.blur(); |
|
|
|
|
|
} |
|
|
|
|
|
$.proxy(module.event.item.click, $selectedItem)(event); |
|
|
$.proxy(module.event.item.click, $selectedItem)(event); |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
return false; |
|
|
return false; |
|
@ -4571,6 +4572,7 @@ $.fn.dropdown = function(parameters) { |
|
|
if( module.can.click() ) { |
|
|
if( module.can.click() ) { |
|
|
module.unbind.intent(); |
|
|
module.unbind.intent(); |
|
|
} |
|
|
} |
|
|
|
|
|
module.focusSearch(); |
|
|
module.hideSubMenus(); |
|
|
module.hideSubMenus(); |
|
|
module.remove.active(); |
|
|
module.remove.active(); |
|
|
} |
|
|
} |
|
@ -7157,6 +7159,11 @@ $.fn.popup = function(parameters) { |
|
|
; |
|
|
; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
reposition: function() { |
|
|
|
|
|
module.refresh(); |
|
|
|
|
|
module.set.position(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
destroy: function() { |
|
|
destroy: function() { |
|
|
module.debug('Destroying previous module'); |
|
|
module.debug('Destroying previous module'); |
|
|
if($popup && !settings.preserve) { |
|
|
if($popup && !settings.preserve) { |
|
@ -7243,7 +7250,7 @@ $.fn.popup = function(parameters) { |
|
|
if(settings.hoverable) { |
|
|
if(settings.hoverable) { |
|
|
module.bind.popup(); |
|
|
module.bind.popup(); |
|
|
} |
|
|
} |
|
|
$.proxy(settings.onCreate, $popup)(); |
|
|
|
|
|
|
|
|
$.proxy(settings.onCreate, $popup)(element); |
|
|
} |
|
|
} |
|
|
else if($target.next(settings.selector.popup).size() !== 0) { |
|
|
else if($target.next(settings.selector.popup).size() !== 0) { |
|
|
module.verbose('Pre-existing popup found, reverting to inline'); |
|
|
module.verbose('Pre-existing popup found, reverting to inline'); |
|
@ -7331,6 +7338,7 @@ $.fn.popup = function(parameters) { |
|
|
|
|
|
|
|
|
removePopup: function() { |
|
|
removePopup: function() { |
|
|
module.debug('Removing popup'); |
|
|
module.debug('Removing popup'); |
|
|
|
|
|
$.proxy(settings.onRemove, $popup)(element); |
|
|
$popup |
|
|
$popup |
|
|
.removePopup() |
|
|
.removePopup() |
|
|
; |
|
|
; |
|
@ -7371,7 +7379,8 @@ $.fn.popup = function(parameters) { |
|
|
duration : settings.duration, |
|
|
duration : settings.duration, |
|
|
onComplete : function() { |
|
|
onComplete : function() { |
|
|
module.bind.close(); |
|
|
module.bind.close(); |
|
|
$.proxy(callback, element)(); |
|
|
|
|
|
|
|
|
$.proxy(callback, $popup)(element); |
|
|
|
|
|
$.proxy(settings.onVisible, $popup)(element); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
; |
|
|
; |
|
@ -7386,7 +7395,7 @@ $.fn.popup = function(parameters) { |
|
|
}) |
|
|
}) |
|
|
; |
|
|
; |
|
|
} |
|
|
} |
|
|
$.proxy(settings.onShow, element)(); |
|
|
|
|
|
|
|
|
$.proxy(settings.onShow, $popup)(element); |
|
|
}, |
|
|
}, |
|
|
hide: function(callback) { |
|
|
hide: function(callback) { |
|
|
callback = $.isFunction(callback) ? callback : function(){}; |
|
|
callback = $.isFunction(callback) ? callback : function(){}; |
|
@ -7401,7 +7410,8 @@ $.fn.popup = function(parameters) { |
|
|
verbose : settings.verbose, |
|
|
verbose : settings.verbose, |
|
|
onComplete : function() { |
|
|
onComplete : function() { |
|
|
module.reset(); |
|
|
module.reset(); |
|
|
callback(); |
|
|
|
|
|
|
|
|
$.proxy(callback, $popup)(element); |
|
|
|
|
|
$.proxy(settings.onHidden, $popup)(element); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
; |
|
|
; |
|
@ -7415,7 +7425,7 @@ $.fn.popup = function(parameters) { |
|
|
}) |
|
|
}) |
|
|
; |
|
|
; |
|
|
} |
|
|
} |
|
|
$.proxy(settings.onHide, element)(); |
|
|
|
|
|
|
|
|
$.proxy(settings.onHide, $popup)(element); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -7438,8 +7448,9 @@ $.fn.popup = function(parameters) { |
|
|
} |
|
|
} |
|
|
return false; |
|
|
return false; |
|
|
}, |
|
|
}, |
|
|
offstagePosition: function() { |
|
|
|
|
|
|
|
|
offstagePosition: function(position) { |
|
|
var |
|
|
var |
|
|
|
|
|
position = position || false, |
|
|
boundary = { |
|
|
boundary = { |
|
|
top : $(window).scrollTop(), |
|
|
top : $(window).scrollTop(), |
|
|
bottom : $(window).scrollTop() + $(window).height(), |
|
|
bottom : $(window).scrollTop() + $(window).height(), |
|
@ -7448,13 +7459,14 @@ $.fn.popup = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
popup = { |
|
|
popup = { |
|
|
width : $popup.width(), |
|
|
width : $popup.width(), |
|
|
height : $popup.outerHeight(), |
|
|
|
|
|
|
|
|
height : $popup.height(), |
|
|
offset : $popup.offset() |
|
|
offset : $popup.offset() |
|
|
}, |
|
|
}, |
|
|
offstage = {}, |
|
|
offstage = {}, |
|
|
offstagePositions = [] |
|
|
offstagePositions = [] |
|
|
; |
|
|
; |
|
|
if(popup.offset) { |
|
|
|
|
|
|
|
|
if(popup.offset && position) { |
|
|
|
|
|
module.verbose('Checking if outside viewable area', popup.offset); |
|
|
offstage = { |
|
|
offstage = { |
|
|
top : (popup.offset.top < boundary.top), |
|
|
top : (popup.offset.top < boundary.top), |
|
|
bottom : (popup.offset.top + popup.height > boundary.bottom), |
|
|
bottom : (popup.offset.top + popup.height > boundary.bottom), |
|
@ -7462,7 +7474,6 @@ $.fn.popup = function(parameters) { |
|
|
left : (popup.offset.left < boundary.left) |
|
|
left : (popup.offset.left < boundary.left) |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
module.verbose('Checking if outside viewable area', popup.offset); |
|
|
|
|
|
// return only boundaries that have been surpassed
|
|
|
// return only boundaries that have been surpassed
|
|
|
$.each(offstage, function(direction, isOffstage) { |
|
|
$.each(offstage, function(direction, isOffstage) { |
|
|
if(isOffstage) { |
|
|
if(isOffstage) { |
|
@ -7517,17 +7528,22 @@ $.fn.popup = function(parameters) { |
|
|
popupWidth = $popup.outerWidth(), |
|
|
popupWidth = $popup.outerWidth(), |
|
|
popupHeight = $popup.outerHeight(), |
|
|
popupHeight = $popup.outerHeight(), |
|
|
|
|
|
|
|
|
parentWidth = $offsetParent.outerWidth(), |
|
|
|
|
|
parentHeight = $offsetParent.outerHeight(), |
|
|
|
|
|
|
|
|
parentWidth = ( $offsetParent.is('html') ) |
|
|
|
|
|
? $offsetParent.find('body').width() |
|
|
|
|
|
: $offsetParent.outerWidth(), |
|
|
|
|
|
|
|
|
|
|
|
parentHeight = ( $offsetParent.is('html') ) |
|
|
|
|
|
? $offsetParent.find('body').height() |
|
|
|
|
|
: $offsetParent.outerHeight(), |
|
|
|
|
|
|
|
|
distanceAway = settings.distanceAway, |
|
|
distanceAway = settings.distanceAway, |
|
|
|
|
|
|
|
|
targetElement = $target[0], |
|
|
targetElement = $target[0], |
|
|
|
|
|
|
|
|
marginTop = (settings.inline) |
|
|
|
|
|
|
|
|
marginTop = (settings.inline) |
|
|
? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-top'), 10) |
|
|
? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-top'), 10) |
|
|
: 0, |
|
|
: 0, |
|
|
marginLeft = (settings.inline) |
|
|
|
|
|
|
|
|
marginLeft = (settings.inline) |
|
|
? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-left'), 10) |
|
|
? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-left'), 10) |
|
|
: 0, |
|
|
: 0, |
|
|
|
|
|
|
|
@ -7540,7 +7556,6 @@ $.fn.popup = function(parameters) { |
|
|
; |
|
|
; |
|
|
position = position || $module.data(metadata.position) || settings.position; |
|
|
position = position || $module.data(metadata.position) || settings.position; |
|
|
arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset; |
|
|
arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset; |
|
|
|
|
|
|
|
|
if(settings.inline) { |
|
|
if(settings.inline) { |
|
|
module.debug('Adding targets margin to calculation'); |
|
|
module.debug('Adding targets margin to calculation'); |
|
|
if(position == 'left center' || position == 'right center') { |
|
|
if(position == 'left center' || position == 'right center') { |
|
@ -7634,7 +7649,7 @@ $.fn.popup = function(parameters) { |
|
|
.addClass(className.loading) |
|
|
.addClass(className.loading) |
|
|
; |
|
|
; |
|
|
// check if is offstage
|
|
|
// check if is offstage
|
|
|
offstagePosition = module.get.offstagePosition(); |
|
|
|
|
|
|
|
|
offstagePosition = module.get.offstagePosition(position); |
|
|
// recursively find new positioning
|
|
|
// recursively find new positioning
|
|
|
if(offstagePosition) { |
|
|
if(offstagePosition) { |
|
|
module.debug('Element is outside boundaries', offstagePosition); |
|
|
module.debug('Element is outside boundaries', offstagePosition); |
|
@ -7942,8 +7957,11 @@ $.fn.popup.settings = { |
|
|
|
|
|
|
|
|
onCreate : function(){}, |
|
|
onCreate : function(){}, |
|
|
onRemove : function(){}, |
|
|
onRemove : function(){}, |
|
|
|
|
|
|
|
|
onShow : function(){}, |
|
|
onShow : function(){}, |
|
|
|
|
|
onVisible : function(){}, |
|
|
onHide : function(){}, |
|
|
onHide : function(){}, |
|
|
|
|
|
onHidden : function(){}, |
|
|
|
|
|
|
|
|
variation : '', |
|
|
variation : '', |
|
|
content : false, |
|
|
content : false, |
|
|