@@ -94,7 +94,7 @@ mpl.figure.prototype._init_toolbar = function () {
94
94
var fig = this ;
95
95
96
96
var toolbar = document . createElement ( 'div' ) ;
97
- toolbar . setAttribute ( 'style' , 'width: 100%' ) ;
97
+ toolbar . classList = 'btn-toolbar' ;
98
98
this . root . appendChild ( toolbar ) ;
99
99
100
100
function on_click_closure ( name ) {
@@ -109,6 +109,8 @@ mpl.figure.prototype._init_toolbar = function () {
109
109
} ;
110
110
}
111
111
112
+ var buttonGroup = document . createElement ( 'div' ) ;
113
+ buttonGroup . classList = 'btn-group' ;
112
114
var button ;
113
115
for ( var toolbar_ind in mpl . toolbar_items ) {
114
116
var name = mpl . toolbar_items [ toolbar_ind ] [ 0 ] ;
@@ -117,6 +119,12 @@ mpl.figure.prototype._init_toolbar = function () {
117
119
var method_name = mpl . toolbar_items [ toolbar_ind ] [ 3 ] ;
118
120
119
121
if ( ! name ) {
122
+ /* Instead of a spacer, we start a new button group. */
123
+ if ( buttonGroup . hasChildNodes ( ) ) {
124
+ toolbar . appendChild ( buttonGroup ) ;
125
+ }
126
+ buttonGroup = document . createElement ( 'div' ) ;
127
+ buttonGroup . classList = 'btn-group' ;
120
128
continue ;
121
129
}
122
130
@@ -127,13 +135,16 @@ mpl.figure.prototype._init_toolbar = function () {
127
135
button . innerHTML = '<i class="fa ' + image + ' fa-lg"></i>' ;
128
136
button . addEventListener ( 'click' , on_click_closure ( method_name ) ) ;
129
137
button . addEventListener ( 'mouseover' , on_mouseover_closure ( tooltip ) ) ;
130
- toolbar . appendChild ( button ) ;
138
+ buttonGroup . appendChild ( button ) ;
139
+ }
140
+
141
+ if ( buttonGroup . hasChildNodes ( ) ) {
142
+ toolbar . appendChild ( buttonGroup ) ;
131
143
}
132
144
133
145
// Add the status bar.
134
146
var status_bar = document . createElement ( 'span' ) ;
135
- status_bar . classList = 'mpl-message' ;
136
- status_bar . setAttribute ( 'style' , 'text-align:right; float: right;' ) ;
147
+ status_bar . classList = 'mpl-message pull-right' ;
137
148
toolbar . appendChild ( status_bar ) ;
138
149
this . message = status_bar ;
139
150
0 commit comments