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
/** | |
* Simple jquery extension to find all elements in a certain Angular scope. | |
* Usage: | |
* | |
* var myElement = $.inScope('.item', $scope); | |
* | |
* @param {string} selector | |
* @param {Angular.Scope} $scope | |
* @returns {jQuery} | |
*/ |
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
######################################################################### | |
# Tiny jQuery plugin that lets us do actions on hidden elements, so we | |
# can grab heights and such! | |
########################################################################## | |
$.fn.whileHidden = (action, args...) -> | |
r = @show()[action](args...) | |
@hide() | |
return r |
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
/** | |
Handy function to get (kind of) significant figures from Javascript numbers. | |
Unlike built-in Javascript methods, this works for all numbers, not just decimals. | |
Example: sigFigs(12345, 2) -> 12000 | |
sigFigs(0.022, 1) -> 0.02 | |
**/ | |
function sigFigs(num, figures) { |
NewerOlder