Skip to content

Commit

Permalink
Title new buttons with label if action undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk authored Aug 12, 2020
1 parent 7ca3b22 commit 311a4c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion notebook/static/notebook/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ define(['jquery','base/js/i18n'], function($, i18n) {
action = that.actions.get(el.action);
action_name = el.action
}
var title = el.label;
if(action && action.help) {
title = i18n.msg._(action.help) || el.label;
}
var button = $('<button/>')
.addClass('btn btn-default')
.attr("aria-label", el.label)
.attr("title", i18n.msg._(action.help)||el.label)
.attr("title", title)
.append(
$("<i/>").addClass(el.icon||(action||{icon:'fa-exclamation-triangle'}).icon).addClass('fa')
);
Expand Down

0 comments on commit 311a4c7

Please sign in to comment.