rename id option to toolbarId avoid conflicts with Backbone.View options
This commit is contained in:
Родитель
897f95a417
Коммит
364c7d06f0
|
@ -3,7 +3,7 @@ import 'bootstrap-webpack';
|
|||
|
||||
window.toolbar = new ToolbarView({
|
||||
el: '.toolbar-container',
|
||||
id: 'demo-toolbar',
|
||||
toolbarId: 'demo-toolbar',
|
||||
items: [{
|
||||
type: 'button',
|
||||
classes: ['btn', 'btn-primary'],
|
||||
|
|
|
@ -49,12 +49,12 @@ function renderItemTree(root) {
|
|||
|
||||
export class ToolbarView extends Backbone.View {
|
||||
initialize({
|
||||
id = _.uniqueId('toolbar-'),
|
||||
toolbarId = _.uniqueId('toolbar-'),
|
||||
classes = [],
|
||||
items = [],
|
||||
events = {},
|
||||
}) {
|
||||
this._root = { type: 'toolbar', id, classes, items };
|
||||
this._root = { type: 'toolbar', id: toolbarId, classes, items };
|
||||
this._events = events;
|
||||
this._contexts = renderItemTree(this._root);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче