Skip to content

Commit f074a41

Browse files
Merge pull request #14041 from rabbitmq/mergify/bp/v4.1.x/pr-14033
Fix issue introduced by #13512 (backport #14033)
2 parents 0d58cad + 9c652d6 commit f074a41

File tree

3 files changed

+65
-66
lines changed

3 files changed

+65
-66
lines changed

deps/rabbitmq_management/priv/www/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<script src="js/base64.js" type="text/javascript"></script>
1414
<script src="js/global.js" type="text/javascript"></script>
1515
<script src="js/main.js" type="text/javascript"></script>
16+
<script src="js/title.js" type="text/javascript"></script>
1617
<script src="js/prefs.js" type="text/javascript"></script>
1718
<script src="js/formatters.js" type="text/javascript"></script>
1819
<script src="js/charts.js" type="text/javascript"></script>

deps/rabbitmq_management/priv/www/js/dispatcher.js

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,3 @@
1-
(function (factory) {
2-
if (typeof define === 'function' && define.amd) {
3-
define(['jquery', 'sammy'], factory);
4-
} else {
5-
(window.Sammy = window.Sammy || {}).Title = factory(window.jQuery, window.Sammy);
6-
}
7-
}(function ($, Sammy) {
8-
9-
// Sammy.Title is a very simple plugin to easily set the document's title.
10-
// It supplies a helper for setting the title (`title()`) within routes,
11-
// and an app level method for setting the global title (`setTitle()`)
12-
Sammy.Title = function() {
13-
14-
// setTitle allows setting a global title or a function that modifies the
15-
// title for each route/page.
16-
//
17-
// ### Example
18-
//
19-
// // setting a title prefix
20-
// $.sammy(function() {
21-
//
22-
// this.setTitle('My App -');
23-
//
24-
// this.get('#/', function() {
25-
// this.title('Home'); // document's title == "My App - Home"
26-
// });
27-
// });
28-
//
29-
// // setting a title with a function
30-
// $.sammy(function() {
31-
//
32-
// this.setTitle(function(title) {
33-
// return [title, " /// My App"].join('');
34-
// });
35-
//
36-
// this.get('#/', function() {
37-
// this.title('Home'); // document's title == "Home /// My App";
38-
// });
39-
// });
40-
//
41-
this.setTitle = function(title) {
42-
if (!$.isFunction(title)) {
43-
this.title_function = function(additional_title) {
44-
return [title, additional_title].join(' ');
45-
}
46-
} else {
47-
this.title_function = title;
48-
}
49-
};
50-
51-
// *Helper* title() sets the document title, passing it through the function
52-
// defined by setTitle() if set.
53-
this.helper('title', function() {
54-
var new_title = $.makeArray(arguments).join(' ');
55-
if (this.app.title_function) {
56-
new_title = this.app.title_function(new_title);
57-
}
58-
document.title = new_title;
59-
});
60-
61-
};
62-
63-
return Sammy.Title;
64-
65-
}));
66-
671
dispatcher_add(function(sammy) {
682
function path(p, r, t) {
693
sammy.get(p, function() {
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
(function (factory) {
2+
if (typeof define === "function" && define.amd) {
3+
define(["jquery", "sammy"], factory);
4+
} else {
5+
(window.Sammy = window.Sammy || {}).Title = factory(
6+
window.jQuery,
7+
window.Sammy,
8+
);
9+
}
10+
})(function ($, Sammy) {
11+
// Sammy.Title is a very simple plugin to easily set the document's title.
12+
// It supplies a helper for setting the title (`title()`) within routes,
13+
// and an app level method for setting the global title (`setTitle()`)
14+
Sammy.Title = function () {
15+
// setTitle allows setting a global title or a function that modifies the
16+
// title for each route/page.
17+
//
18+
// ### Example
19+
//
20+
// // setting a title prefix
21+
// $.sammy(function() {
22+
//
23+
// this.setTitle('My App -');
24+
//
25+
// this.get('#/', function() {
26+
// this.title('Home'); // document's title == "My App - Home"
27+
// });
28+
// });
29+
//
30+
// // setting a title with a function
31+
// $.sammy(function() {
32+
//
33+
// this.setTitle(function(title) {
34+
// return [title, " /// My App"].join('');
35+
// });
36+
//
37+
// this.get('#/', function() {
38+
// this.title('Home'); // document's title == "Home /// My App";
39+
// });
40+
// });
41+
//
42+
this.setTitle = function (title) {
43+
if (!$.isFunction(title)) {
44+
this.title_function = function (additional_title) {
45+
return [title, additional_title].join(" ");
46+
};
47+
} else {
48+
this.title_function = title;
49+
}
50+
};
51+
52+
// *Helper* title() sets the document title, passing it through the function
53+
// defined by setTitle() if set.
54+
this.helper("title", function () {
55+
var new_title = $.makeArray(arguments).join(" ");
56+
if (this.app.title_function) {
57+
new_title = this.app.title_function(new_title);
58+
}
59+
document.title = new_title;
60+
});
61+
};
62+
63+
return Sammy.Title;
64+
});

0 commit comments

Comments
 (0)