Skip to content

Commit 8c99c5c

Browse files
Mat MannionMat Mannion
authored andcommitted
v2.8.3
1 parent 21e46ab commit 8c99c5c

13 files changed

+57
-48
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ encoding: UTF-8
1717
prefix: /
1818

1919
# Custom variables
20-
current_version: 2.8.2
20+
current_version: 2.8.3

dist/js/7312dc68db4f6e13ff51ba419d319217-id7-bundle.js renamed to dist/js/2c1067aaaa4e7b1e80204169b97a6052-id7-bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/42a6299ce6196b7f39988c08d0ce9560-id7-bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/8fc2d3bc9dfe22a648b51d186cac0554-id7-bundle.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/js/id7-bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/id7-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/id7-bundle.js.map.md5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8fc2d3bc9dfe22a648b51d186cac0554
1+
42a6299ce6196b7f39988c08d0ce9560

dist/js/id7-bundle.js.md5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7312dc68db4f6e13ff51ba419d319217
1+
2c1067aaaa4e7b1e80204169b97a6052

js/bootstrap-3-typeahead.jquery.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* eslint-env browser */
2+
const $ = window.jQuery;
3+
4+
/*
5+
* Adds typeahead support to Bootstrap 3. Forked of a fork
6+
*
7+
* https://github.com/UniversityofWarwick/bootstrap-3-typeahead
8+
*/
9+
require('@universityofwarwick/bootstrap-3-typeahead');
10+
11+
function supportsPassiveEventListeners() {
12+
let supportsPassiveOption = false;
13+
14+
try {
15+
const opts = Object.defineProperty({}, 'passive', {
16+
get: () => {
17+
supportsPassiveOption = true;
18+
return undefined;
19+
},
20+
});
21+
const noop = () => {};
22+
window.addEventListener('testPassiveEventSupport', noop, opts);
23+
window.removeEventListener('testPassiveEventSupport', noop, opts);
24+
} catch (e) {
25+
supportsPassiveOption = false;
26+
}
27+
28+
return supportsPassiveOption;
29+
}
30+
31+
// bootstrap-3-typeahead uses passive touchstart/touchend listeners but uses jQuery which doesn't
32+
// create them with the setting by default. Depends on the passiveeventlisteners test added in
33+
// id7-standalone (id7-default-feature-detect)
34+
// https://github.com/jquery/jquery/issues/2871#issuecomment-497963776
35+
if (supportsPassiveEventListeners() && 'ontouchstart' in document.documentElement && 'addEventListener' in document) {
36+
$.event.special.touchstart = {
37+
setup(_, ns, handle) {
38+
this.addEventListener('touchstart', handle, { passive: true });
39+
},
40+
};
41+
42+
$.event.special.touchend = {
43+
setup(_, ns, handle) {
44+
this.addEventListener('touchend', handle, { passive: true });
45+
},
46+
};
47+
}

js/id7-bundle.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,8 @@ require('./id7-popover');
1818
require('./bootstrap-scrollspy.jquery');
1919
require('./bootstrap-tab.jquery');
2020
require('./bootstrap-affix.jquery');
21-
require('@universityofwarwick/bootstrap-3-typeahead'); // Required for search suggest box
21+
require('./bootstrap-3-typeahead.jquery');
2222
require('jqdoublescroll'); // Required for wide-tables
2323
require('./headroom.jquery');
2424

2525
require('./id7-standalone');
26-
27-
// bootstrap-3-typeahead uses passive touchstart/touchend listeners but uses jQuery which doesn't
28-
// create them with the setting by default. Depends on the passiveeventlisteners test added in
29-
// id7-standalone (id7-default-feature-detect)
30-
// https://github.com/jquery/jquery/issues/2871#issuecomment-497963776
31-
if (window.Modernizr.passiveeventlisteners && 'ontouchstart' in document.documentElement && 'addEventListener' in document) {
32-
$.event.special.touchstart = {
33-
setup(_, ns, handle) {
34-
this.addEventListener('touchstart', handle, { passive: true });
35-
},
36-
};
37-
38-
$.event.special.touchend = {
39-
setup(_, ns, handle) {
40-
this.addEventListener('touchend', handle, { passive: true });
41-
},
42-
};
43-
}

js/id7-default-feature-detect.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,6 @@ detect.addTest('safari', userAgent.indexOf('Safari/') >= 0 && userAgent.indexOf(
6363
detect.addTest('ie-or-edge', /MSIE (?:9|7|10)/i.test(userAgent) || /rv:11.0/i.test(userAgent) || /Edge\/\d./i.test(userAgent));
6464
detect.addTest('embedded-ie', /MSIE 7/i.test(userAgent) && /\.NET/.test(userAgent));
6565

66-
detect.addTest('passiveeventlisteners', () => {
67-
let supportsPassiveOption = false;
68-
69-
try {
70-
const opts = Object.defineProperty({}, 'passive', {
71-
get: () => {
72-
supportsPassiveOption = true;
73-
return undefined;
74-
},
75-
});
76-
const noop = () => {};
77-
window.addEventListener('testPassiveEventSupport', noop, opts);
78-
window.removeEventListener('testPassiveEventSupport', noop, opts);
79-
} catch (e) {
80-
supportsPassiveOption = false;
81-
}
82-
83-
return supportsPassiveOption;
84-
});
85-
8666
// Init
8767
detect.addClasses(document.documentElement);
8868

js/search-suggest.jquery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import $ from 'jquery';
33
import _ from 'lodash-es';
44
import FeatureDetect from './feature-detect';
55

6-
require('@universityofwarwick/bootstrap-3-typeahead');
6+
require('./bootstrap-3-typeahead.jquery');
77

88
/**
99
* Use Bootstrap 3 typeahead to provide Go.Warwick suggestions on an <input>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@universityofwarwick/id7",
3-
"version": "2.8.2",
3+
"version": "2.8.3",
44
"scripts": {
55
"watch": "NODE_ENV=development webpack --mode development --watch",
66
"dev": "NODE_ENV=development webpack --mode development",

0 commit comments

Comments
 (0)