-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Bring in blacklight_range_limit js files
When we have the blacklight_range_limit require in the application.js before the require for blacklight/blacklight, we got a Blacklight not found error (underestandably). However when we put it under the blacklight require then we got a typeahead error. I couldn't get both to work right so instead I'm bringing over the js files from the range limit gem into our app and requiring them in the application.js.
- Loading branch information
Showing
4 changed files
with
29 additions
and
3 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
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
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,24 @@ | ||
|
||
// takes a string and parses into an integer, but throws away commas first, to avoid truncation when there is a comma | ||
// use in place of javascript's native parseInt | ||
!function(global) { | ||
'use strict'; | ||
|
||
var previousBlacklightRangeLimit = global.BlacklightRangeLimit; | ||
|
||
function BlacklightRangeLimit(options) { | ||
this.options = options || {}; | ||
} | ||
|
||
BlacklightRangeLimit.noConflict = function noConflict() { | ||
global.BlacklightRangeLimit = previousBlacklightRangeLimit; | ||
return BlacklightRangeLimit; | ||
}; | ||
|
||
BlacklightRangeLimit.parseNum = function parseNum(str) { | ||
str = String(str).replace(/[^0-9]/g, ''); | ||
return parseInt(str, 10); | ||
}; | ||
|
||
global.BlacklightRangeLimit = BlacklightRangeLimit; | ||
}(this); |
File renamed without changes.