@@ -19,7 +19,7 @@ var Icons = require('../../../build/ploticon');
19
19
* UI controller for interactive plots
20
20
* @Class
21
21
* @Param {object} opts
22
- * @Param {object} opts.buttons nested arrays of grouped buttons to initialize
22
+ * @Param {object} opts.buttons nested arrays of grouped buttons config objects
23
23
* @Param {object} opts.container container div to append modebar
24
24
* @Param {object} opts.graphInfo primary plot object containing data and layout
25
25
*/
@@ -52,6 +52,7 @@ proto.update = function(graphInfo, buttons) {
52
52
}
53
53
else this . element . className = 'modebar' ;
54
54
55
+ // if buttons or logo have changed, redraw modebar interior
55
56
var needsNewButtons = ! this . hasButtons ( buttons ) ,
56
57
needsNewLogo = ( this . hasLogo !== context . displaylogo ) ;
57
58
@@ -78,15 +79,10 @@ proto.updateButtons = function(buttons) {
78
79
this . buttons . forEach ( function ( buttonGroup ) {
79
80
var group = _this . createGroup ( ) ;
80
81
81
- buttonGroup . forEach ( function ( buttonName ) {
82
- var buttonConfig = buttonsConfig [ buttonName ] ;
83
-
84
- if ( ! buttonConfig ) {
85
- throw new Error ( buttonName + 'not specfied in modebar configuration' ) ;
82
+ buttonGroup . forEach ( function ( buttonConfig ) {
86
83
}
87
84
88
85
var button = _this . createButton ( buttonConfig ) ;
89
-
90
86
_this . buttonElements . push ( button ) ;
91
87
group . appendChild ( button ) ;
92
88
} ) ;
@@ -108,7 +104,7 @@ proto.createGroup = function () {
108
104
109
105
/**
110
106
* Create a new button div and set constant and configurable attributes
111
- * @Param {object} config (see ./modebar_config, js for more info)
107
+ * @Param {object} config (see ./buttons. js for more info)
112
108
* @Return {HTMLelement}
113
109
*/
114
110
proto . createButton = function ( config ) {
0 commit comments