rename id option to toolbarId avoid conflicts with Backbone.View options

This commit is contained in:
Wei Wei (BINGADS) 2016-08-24 18:43:00 +08:00
Родитель 897f95a417
Коммит 364c7d06f0
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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);
}