-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Unused File Add Form Action Bug Fix
- Loading branch information
1 parent
d26aacb
commit 2806f14
Showing
321 changed files
with
47,308 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var dropdownSelectors = $('.dropdown, .dropup'); | ||
// Custom function to read dropdown data | ||
// ========================= | ||
function dropdownEffectData(target) { | ||
//@todo - page level global? | ||
var effectInDefault = null, | ||
effectOutDefault = null; | ||
var dropdown = $(target), | ||
dropdownMenu = $('.dropdown-menu', target); | ||
|
||
// var parentUl = dropdown.parents('ul.nav'); | ||
// If parent is ul.nav allow global effect settings | ||
// if (parentUl.length() > 0) { | ||
// effectInDefault = parentUl.data('dropdown-in') || null; | ||
// effectOutDefault = parentUl.data('dropdown-out') || null; | ||
// } | ||
|
||
return { | ||
target: target, | ||
dropdown: dropdown, | ||
dropdownMenu: dropdownMenu, | ||
effectIn: dropdownMenu.data('dropdown-in') || effectInDefault, | ||
effectOut: dropdownMenu.data('dropdown-out') || effectOutDefault, | ||
}; | ||
} | ||
// Custom function to start effect (in or out) | ||
// ========================= | ||
function dropdownEffectStart(data, effectToStart) { | ||
if (effectToStart) { | ||
data.dropdown.addClass('dropdown-animating'); | ||
data.dropdownMenu.addClass('animated'); | ||
data.dropdownMenu.addClass(effectToStart); | ||
} | ||
} | ||
// Custom function to read when animation is over | ||
// ========================= | ||
function dropdownEffectEnd(data, callbackFunc) { | ||
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; | ||
data.dropdown.one(animationEnd, function() { | ||
data.dropdown.removeClass('dropdown-animating'); | ||
data.dropdownMenu.removeClass('animated'); | ||
data.dropdownMenu.removeClass(data.effectIn); | ||
data.dropdownMenu.removeClass(data.effectOut); | ||
|
||
// Custom callback option, used to remove open class in out effect | ||
if(typeof callbackFunc == 'function'){ | ||
callbackFunc(); | ||
} | ||
}); | ||
} | ||
// Bootstrap API hooks | ||
// ========================= | ||
dropdownSelectors.on({ | ||
"show.bs.dropdown": function () { | ||
// On show, start in effect | ||
var dropdown = dropdownEffectData(this); | ||
dropdownEffectStart(dropdown, dropdown.effectIn); | ||
}, | ||
"shown.bs.dropdown": function () { | ||
// On shown, remove in effect once complete | ||
var dropdown = dropdownEffectData(this); | ||
if (dropdown.effectIn && dropdown.effectOut) { | ||
dropdownEffectEnd(dropdown, function() {}); | ||
} | ||
}, | ||
"hide.bs.dropdown": function(e) { | ||
// On hide, start out effect | ||
var dropdown = dropdownEffectData(this); | ||
if (dropdown.effectOut) { | ||
e.preventDefault(); | ||
dropdownEffectStart(dropdown, dropdown.effectOut); | ||
dropdownEffectEnd(dropdown, function() { | ||
dropdown.dropdown.removeClass('open'); | ||
}); | ||
} | ||
}, | ||
}); |
Oops, something went wrong.