', { class: this.ppfx + 'highlighter' }).get(0);
diff --git a/src/class_manager/view/ClassTagsView.js b/src/class_manager/view/ClassTagsView.js
index 5663151fc..45951ccaa 100644
--- a/src/class_manager/view/ClassTagsView.js
+++ b/src/class_manager/view/ClassTagsView.js
@@ -136,7 +136,9 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
});
var state = this.compTarget.get('state');
result = state ? result + ':' + state : result;
- this.el.querySelector('#' + this.pfx + 'sel').innerHTML = result;
+ var el = this.el.querySelector('#' + this.pfx + 'sel');
+ if(el)
+ el.innerHTML = result;
},
/**
diff --git a/src/commands/view/CommandAbstract.js b/src/commands/view/CommandAbstract.js
index c74deb53f..163081996 100644
--- a/src/commands/view/CommandAbstract.js
+++ b/src/commands/view/CommandAbstract.js
@@ -28,14 +28,15 @@ define(['backbone'],
if(this.editorModel.get)
this.setElement(this.getCanvas());
- this.$canvas = this.$el;
- this.$wrapper = $(this.getCanvasWrapper());
+ if(this.canvas){
+ this.$canvas = this.$el;
+ this.$wrapper = $(this.getCanvasWrapper());
+ this.frameEl = this.canvas.getFrameEl();
+ this.canvasTool = this.getCanvasTools();
+ this.bodyEl = this.getCanvasBody();
+ }
this.init(this.config);
-
- this.frameEl = this.canvas.getFrameEl();
- this.canvasTool = this.getCanvasTools();
- this.bodyEl = this.getCanvasBody();
},
/**
diff --git a/src/panels/main.js b/src/panels/main.js
index 43760fbb2..10547bd62 100644
--- a/src/panels/main.js
+++ b/src/panels/main.js
@@ -100,7 +100,7 @@ define(function(require) {
* @example
* var myPanel = panelManager.getPanel('myNewPanel');
*/
- getPanel : function(id){
+ getPanel: function(id){
var res = panels.where({id: id});
return res.length ? res[0] : null;
},
@@ -119,7 +119,7 @@ define(function(require) {
* active: false,
* });
*/
- addButton : function(panelId, button){
+ addButton: function(panelId, button){
var pn = this.getPanel(panelId);
return pn ? pn.get('buttons').add(button) : null;
},
@@ -132,7 +132,7 @@ define(function(require) {
* @example
* var button = panelManager.getButton('myPanel','myButton');
*/
- getButton : function(panelId, id){
+ getButton: function(panelId, id){
var pn = this.getPanel(panelId);
if(pn){
var res = pn.get('buttons').where({id: id});
@@ -145,7 +145,7 @@ define(function(require) {
* Render panels and buttons
* @return {HTMLElement}
*/
- render : function(){
+ render: function(){
return PanelsViewObj.render().el;
},
@@ -153,7 +153,7 @@ define(function(require) {
* Active activable buttons
* @private
*/
- active : function(){
+ active: function(){
this.getPanels().each(function(p){
p.get('buttons').each(function(btn){
if(btn.get('active'))
diff --git a/src/panels/view/ButtonView.js b/src/panels/view/ButtonView.js
index 6505f2e1d..c3c73f8c0 100644
--- a/src/panels/view/ButtonView.js
+++ b/src/panels/view/ButtonView.js
@@ -41,18 +41,19 @@ function(Backbone, require) {
this.events.click = 'clicked';
this.delegateEvents();
- this.canvasEl = this.em.Canvas.CanvasView.$el.get(0);
-
- this.sorter = new this.em.Utils.Sorter({
- container: this.canvasEl,
- containerSel: '*',
- itemSel: '*',
- pfx: this.ppfx,
- onMove: this.onDrag,
- onEndMove: this.onDrop,
- direction: 'auto',
- nested: 1,
- });
+ if(this.em.Canvas){
+ this.canvasEl = this.em.Canvas.getElement();
+ this.sorter = new this.em.Utils.Sorter({
+ container: this.canvasEl,
+ containerSel: '*',
+ itemSel: '*',
+ pfx: this.ppfx,
+ onMove: this.onDrag,
+ onEndMove: this.onDrop,
+ direction: 'auto',
+ nested: 1,
+ });
+ }
},
/**
diff --git a/test/specs/dom_components/view/ComponentImageView.js b/test/specs/dom_components/view/ComponentImageView.js
index bd55f75cb..dd5324bb2 100644
--- a/test/specs/dom_components/view/ComponentImageView.js
+++ b/test/specs/dom_components/view/ComponentImageView.js
@@ -35,7 +35,7 @@ define([path + 'ComponentImageView', 'DomComponents/model/Component'],
});
it('Component empty', function() {
- $fixture.html().should.equal('
![]()
');
+ $fixture.html().should.equal('
![]()
');
});
it('TagName is
![]()
', function() {