Skip to content

Commit cd9d0c9

Browse files
authored
Merge pull request #5676 from jupyter/title-by-label
Title new buttons with label if action undefined
2 parents 7ca3b22 + 311a4c7 commit cd9d0c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

notebook/static/notebook/js/toolbar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,14 @@ define(['jquery','base/js/i18n'], function($, i18n) {
9292
action = that.actions.get(el.action);
9393
action_name = el.action
9494
}
95+
var title = el.label;
96+
if(action && action.help) {
97+
title = i18n.msg._(action.help) || el.label;
98+
}
9599
var button = $('<button/>')
96100
.addClass('btn btn-default')
97101
.attr("aria-label", el.label)
98-
.attr("title", i18n.msg._(action.help)||el.label)
102+
.attr("title", title)
99103
.append(
100104
$("<i/>").addClass(el.icon||(action||{icon:'fa-exclamation-triangle'}).icon).addClass('fa')
101105
);

0 commit comments

Comments
 (0)