blacklight_range_limit 6.1.1 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight_range_limit/range_limit_distro_facets.js +27 -27
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97ddf1ebca36774bb73a9d4d4de5fd6b99ea0bb4
|
4
|
+
data.tar.gz: e47912a11157c9123a360c04b73cf09f2cded2cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 578e651961133f7e5a1f7f524b7c6aec58c9b3895017a30efad6d387b080a008851352b71d2d182ffd7ae06928764c4e447e9b76bfc82e84792ab4f8d30a6411
|
7
|
+
data.tar.gz: 99437a54195da9626c8c41bec83705979e7be2a0fde3016f0e3d4cd10133b55c9d7cbcd5d64f99968ce19b499d4a53d3d9f6a8ce4dc6410fe41f46fde24f9cb4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.1.
|
1
|
+
6.1.2
|
@@ -2,12 +2,12 @@
|
|
2
2
|
//= require blacklight/core
|
3
3
|
|
4
4
|
/* A custom event "plotDrawn.blacklight.rangeLimit" will be sent when flot plot
|
5
|
-
is (re-)drawn on screen possibly with a new size. target of event will be the DOM element
|
5
|
+
is (re-)drawn on screen possibly with a new size. target of event will be the DOM element
|
6
6
|
containing the plot. Used to resize slider to match. */
|
7
7
|
|
8
8
|
Blacklight.onLoad(function() {
|
9
9
|
// ratio of width to height for desired display, multiply width by this ratio
|
10
|
-
// to get height. hard-coded in for now.
|
10
|
+
// to get height. hard-coded in for now.
|
11
11
|
var display_ratio = 1/(1.618 * 2); // half a golden rectangle, why not
|
12
12
|
var redrawnEvent = "plotDrawn.blacklight.rangeLimit";
|
13
13
|
|
@@ -31,7 +31,7 @@ Blacklight.onLoad(function() {
|
|
31
31
|
});
|
32
32
|
|
33
33
|
// Listen for twitter bootstrap collapsible open events, to render flot
|
34
|
-
// in previously hidden divs on open, if needed.
|
34
|
+
// in previously hidden divs on open, if needed.
|
35
35
|
$("body").on("show.bs.collapse", function(event) {
|
36
36
|
// Was the target a .facet-content including a .chart-js?
|
37
37
|
var container = $(event.target).filter(".facet-content").find(".chart_js");
|
@@ -41,7 +41,7 @@ Blacklight.onLoad(function() {
|
|
41
41
|
// be willing to wait up to 1100ms for container to
|
42
42
|
// have width -- right away on show.bs is too soon, but
|
43
43
|
// shown.bs is later than we want, we want to start rendering
|
44
|
-
// while animation is still in progress.
|
44
|
+
// while animation is still in progress.
|
45
45
|
turnIntoPlot(container, 1100);
|
46
46
|
}
|
47
47
|
});
|
@@ -51,14 +51,14 @@ Blacklight.onLoad(function() {
|
|
51
51
|
// after a collapsible facet contents is fully shown,
|
52
52
|
// resize the flot chart to current conditions. This way, if you change
|
53
53
|
// browser window size, you can get chart resized to fit by closing and opening
|
54
|
-
// again, if needed.
|
54
|
+
// again, if needed.
|
55
55
|
|
56
56
|
function redrawPlot(container) {
|
57
57
|
if (container && container.width() > 0) {
|
58
|
-
// resize the container's height, since width may have changed.
|
58
|
+
// resize the container's height, since width may have changed.
|
59
59
|
container.height( container.width() * display_ratio );
|
60
60
|
|
61
|
-
// redraw the chart.
|
61
|
+
// redraw the chart.
|
62
62
|
var plot = container.data("plot");
|
63
63
|
if (plot) {
|
64
64
|
// how to redraw after possible resize?
|
@@ -74,7 +74,7 @@ Blacklight.onLoad(function() {
|
|
74
74
|
// send our custom event to trigger redraw of slider
|
75
75
|
$(container).trigger(redrawnEvent);
|
76
76
|
}
|
77
|
-
}
|
77
|
+
}
|
78
78
|
}
|
79
79
|
|
80
80
|
$("body").on("shown.bs.collapse", function(event) {
|
@@ -114,25 +114,25 @@ Blacklight.onLoad(function() {
|
|
114
114
|
// container is finally visible. The timeout is used when we catch
|
115
115
|
// bootstrap show event, but the animation hasn't barely begun yet -- but
|
116
116
|
// we don't want to wait until it's finished, we want to start rendering
|
117
|
-
// as soon as we can.
|
117
|
+
// as soon as we can.
|
118
118
|
//
|
119
|
-
// We also will
|
119
|
+
// We also will
|
120
120
|
function turnIntoPlot(container, wait_for_visible) {
|
121
121
|
// flot can only render in a a div with a defined width.
|
122
122
|
// for instance, a hidden div can't generally be rendered in (although if you set
|
123
123
|
// an explicit width on it, it might work)
|
124
124
|
//
|
125
125
|
// We'll count on later code that catch bootstrap collapse open to render
|
126
|
-
// on show, for currently hidden divs.
|
126
|
+
// on show, for currently hidden divs.
|
127
127
|
|
128
128
|
// for some reason width sometimes return negative, not sure
|
129
|
-
// why but it's some kind of hidden.
|
130
|
-
if (container.width() > 0) {
|
129
|
+
// why but it's some kind of hidden.
|
130
|
+
if (container.width() > 0) {
|
131
131
|
var height = container.width() * display_ratio;
|
132
|
-
|
133
|
-
// Need an explicit height to make flot happy.
|
132
|
+
|
133
|
+
// Need an explicit height to make flot happy.
|
134
134
|
container.height( height )
|
135
|
-
|
135
|
+
|
136
136
|
areaChart($(container));
|
137
137
|
|
138
138
|
$(container).trigger(redrawnEvent);
|
@@ -199,14 +199,14 @@ Blacklight.onLoad(function() {
|
|
199
199
|
|
200
200
|
find_segment_for = function_for_find_segment(pointer_lookup);
|
201
201
|
var last_segment = null;
|
202
|
+
$('.distribution').tooltip({'placement': 'bottom', 'trigger': 'manual', 'delay': { show: 0, hide: 100}});
|
202
203
|
|
203
204
|
$(container).bind("plothover", function (event, pos, item) {
|
204
205
|
segment = find_segment_for(pos.x);
|
205
206
|
|
206
207
|
if(segment != last_segment) {
|
207
|
-
|
208
|
-
$('.distribution').
|
209
|
-
$('.distribution').tooltip('show');
|
208
|
+
var title = find_segment_for(pos.x).label + ' (' + BlacklightRangeLimit.parseNum(segment.count) + ')';
|
209
|
+
$('.distribution').attr("title", title).tooltip("fixTitle").tooltip("show");
|
210
210
|
|
211
211
|
last_segment = segment;
|
212
212
|
}
|
@@ -222,7 +222,7 @@ Blacklight.onLoad(function() {
|
|
222
222
|
plot.setSelection( normalized_selection(segment.from, segment.to));
|
223
223
|
}
|
224
224
|
});
|
225
|
-
$(container).bind("plotselected plotselecting", function(event, ranges) {
|
225
|
+
$(container).bind("plotselected plotselecting", function(event, ranges) {
|
226
226
|
if (ranges != null ) {
|
227
227
|
var from = Math.floor(ranges.xaxis.from);
|
228
228
|
var to = Math.floor(ranges.xaxis.to);
|
@@ -230,11 +230,11 @@ Blacklight.onLoad(function() {
|
|
230
230
|
var form = $(container).closest(".limit_content").find("form.range_limit");
|
231
231
|
form.find("input.range_begin").val(from);
|
232
232
|
form.find("input.range_end").val(to);
|
233
|
-
|
233
|
+
|
234
234
|
var slider_placeholder = $(container).closest(".limit_content").find("[data-slider-placeholder]");
|
235
235
|
if (slider_placeholder) {
|
236
|
-
|
237
|
-
}
|
236
|
+
slider_placeholder.slider("setValue", [from, to+1]);
|
237
|
+
}
|
238
238
|
}
|
239
239
|
});
|
240
240
|
|
@@ -288,13 +288,13 @@ Blacklight.onLoad(function() {
|
|
288
288
|
return pointer_lookup_arr[0];
|
289
289
|
};
|
290
290
|
}
|
291
|
-
|
291
|
+
|
292
292
|
// Check if Flot is loaded, and if browser has support for
|
293
|
-
// canvas object, either natively or via IE excanvas.
|
294
|
-
function domDependenciesMet() {
|
293
|
+
// canvas object, either natively or via IE excanvas.
|
294
|
+
function domDependenciesMet() {
|
295
295
|
var flotLoaded = (typeof $.plot != "undefined");
|
296
296
|
var canvasAvailable = ((typeof(document.createElement('canvas').getContext) != "undefined") || (typeof window.CanvasRenderingContext2D != 'undefined' || typeof G_vmlCanvasManager != 'undefined'));
|
297
297
|
|
298
298
|
return (flotLoaded && canvasAvailable);
|
299
299
|
}
|
300
|
-
});
|
300
|
+
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_range_limit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.
|
247
|
+
rubygems_version: 2.5.2
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Blacklight Range Limit plugin
|