Skip to content

Commit 5fcb9e9

Browse files
author
Steven Silvester
committed
Revert "Upgraded typeahead library. (jupyter#4944)"
This reverts commit 33548e1.
1 parent dee53a1 commit 5fcb9e9

File tree

5 files changed

+22
-26
lines changed

5 files changed

+22
-26
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"google-caja": "5669",
1313
"jed": "~1.1.1",
1414
"jquery": "components/jquery#~3.4.1",
15-
"jquery-typeahead": "~2.10.6",
15+
"jquery-typeahead": "~2.0.0",
1616
"jquery-ui": "components/jqueryui#~1.12",
1717
"marked": "~0.4",
1818
"MathJax": "^2.7.4",

notebook/static/notebook/js/commandpalette.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ define([
4444
// typeahead lib need a specific layout with specific class names.
4545
// the following just does that
4646
var form = $('<form/>');
47-
var container = $('<div/>').addClass('typeahead__container');
48-
var field = $('<div/>').addClass('typeahead__field');
47+
var container = $('<div/>').addClass('typeahead-container');
48+
var field = $('<div/>').addClass('typeahead-field');
4949
var input = $('<input/>').attr('type', 'search');
5050

5151
field
5252
.append(
53-
$('<span>').addClass('typeahead__query').append(
53+
$('<span>').addClass('typeahead-query').append(
5454
input
5555
)
5656
)
5757
.append(
58-
$('<span/>').addClass('typeahead__button').append(
58+
$('<span/>').addClass('typeahead-button').append(
5959
$('<button/>').attr('type', 'submit').append(
60-
$('<span/>').addClass('typeahead__search-icon')
60+
$('<span/>').addClass('typeahead-search-icon')
6161
)
6262
)
6363
);
@@ -185,9 +185,7 @@ define([
185185
maxItem: 1e3,
186186
minLength: 0,
187187
hint: true,
188-
group: {
189-
template:"{{group}} command group"
190-
},
188+
group: ["group", "{{group}} command group"],
191189
searchOnFocus: true,
192190
mustSelectItem: true,
193191
template: '<i class="fa fa-icon {{icon}}"></i>{{display}} <div title={{key}} class="pull-right {{mode_shortcut}}">{{shortcut}}</div>',

notebook/static/notebook/js/main.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ var bind = function bind(obj) {
1919
};
2020
Function.prototype.bind = Function.prototype.bind || bind ;
2121

22-
requirejs.config({
23-
map: {
24-
"*": {
25-
"typeahead": "jquery-typeahead"
26-
}
27-
}
28-
})
2922

3023
requirejs([
3124
'jquery',

notebook/static/notebook/less/commandpalette.less

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
div.typeahead__container {
2-
font: revert;
1+
ul.typeahead-list i{
2+
margin-left: -10px;
3+
width: 18px;
34
}
45

5-
ul.typeahead__list i {
6-
width: 18px;
6+
[dir="rtl"] ul.typeahead-list i {
7+
margin-left: 0;
8+
margin-right: -10px;
79
}
810

9-
ul.typeahead__list {
11+
ul.typeahead-list {
1012
max-height: 80vh;
1113
overflow:auto;
1214

@@ -17,11 +19,11 @@ ul.typeahead__list {
1719
}
1820
}
1921

20-
ul.typeahead__list & > li > a.pull-right {
22+
ul.typeahead-list & > li > a.pull-right {
2123
.pull-left();
2224
}
2325

24-
[dir="rtl"] .typeahead__list {
26+
[dir="rtl"] .typeahead-list {
2527
text-align : right;
2628
}
2729

tools/build-main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,21 @@ var rjs_config = {
2525
moment: 'components/moment/min/moment-with-locales',
2626
codemirror: 'components/codemirror',
2727
xterm: 'components/xterm.js/index',
28-
"xtermjs-fit": 'components/xterm.js-fit/index',
29-
"jquery-typeahead": 'components/jquery-typeahead/dist/jquery.typeahead.min',
28+
'xtermjs-fit': 'components/xterm.js-fit/index',
29+
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead',
3030
contents: 'empty:',
3131
custom: 'empty:',
3232
},
3333
map: { // for backward compatibility
3434
"*": {
3535
"jqueryui": "jquery-ui",
36-
"typeahead": "jquery-typeahead"
3736
}
3837
},
3938
shim: {
39+
typeahead: {
40+
deps: ["jquery"],
41+
exports: "typeahead"
42+
},
4043
underscore: {
4144
exports: '_'
4245
},

0 commit comments

Comments
 (0)