mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
51 lines
1.1 KiB
define(['backbone','./CommandButtonView'],
|
|
function (Backbone, CommandButtonView) {
|
|
/**
|
|
* @class CommandButtonsView
|
|
* */
|
|
return Backbone.View.extend({
|
|
|
|
className: 'no-dots',
|
|
|
|
attributes : {
|
|
'data-role' : 'editor-toolbar',
|
|
},
|
|
|
|
initialize: function(o){
|
|
this.config = o.config || {};
|
|
this.id = this.config.stylePrefix + this.config.toolbarId;
|
|
this.$el.data('helper',1);
|
|
},
|
|
|
|
/**
|
|
* Update RTE target pointer
|
|
* @param {String} target
|
|
*
|
|
* @return this
|
|
* */
|
|
updateTarget: function(target){
|
|
this.$el.attr('data-target',target);
|
|
return this;
|
|
},
|
|
|
|
render: function() {
|
|
var fragment = document.createDocumentFragment();
|
|
this.$el.empty();
|
|
|
|
this.collection.each(function(item){
|
|
var view = new CommandButtonView({
|
|
model : item,
|
|
config : this.config,
|
|
attributes : {
|
|
'title' : item.get('title'),
|
|
'data-edit' : item.get('command'),
|
|
},
|
|
});
|
|
fragment.appendChild(view.render().el);
|
|
},this);
|
|
this.$el.append(fragment);
|
|
this.$el.attr('id', _.result( this, 'id' ) );
|
|
return this;
|
|
}
|
|
});
|
|
});
|
|
|