mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-13 13:17:50 +08:00
Tooltip on toggle button
This commit is contained in:
parent
0a22217f7e
commit
7ac82931ca
@ -76,7 +76,7 @@ define([
|
||||
e.preventDefault();
|
||||
that.handle_click();
|
||||
}));
|
||||
|
||||
this.$el.attr("data-toggle", "tooltip");
|
||||
this.model.on('change:button_style', function(model, value) {
|
||||
this.update_button_style();
|
||||
}, this);
|
||||
@ -113,6 +113,7 @@ define([
|
||||
this.$el.prop('disabled', disabled);
|
||||
|
||||
var description = this.model.get('description');
|
||||
this.$el.attr("title", this.model.get("tooltip"));
|
||||
if (description.trim().length === 0) {
|
||||
this.$el.html(" "); // Preserve button height
|
||||
} else {
|
||||
|
@ -38,6 +38,7 @@ class ToggleButton(_Bool):
|
||||
"""Displays a boolean `value`."""
|
||||
|
||||
_view_name = Unicode('ToggleButtonView', sync=True)
|
||||
tooltip = Unicode(help="Tooltip caption of the toggle button.", sync=True)
|
||||
|
||||
button_style = CaselessStrEnum(
|
||||
values=['primary', 'success', 'info', 'warning', 'danger', ''],
|
||||
|
Loading…
x
Reference in New Issue
Block a user