diff --git a/src/block_manager/view/BlocksView.js b/src/block_manager/view/BlocksView.js index f3b1dbeec..52a3d432c 100644 --- a/src/block_manager/view/BlocksView.js +++ b/src/block_manager/view/BlocksView.js @@ -80,10 +80,14 @@ function(Backbone, BlockView) { * Callback when block is dropped * @private */ - onDrop: function(){ + onDrop: function(model){ this.em.runDefault(); this.em.get('Canvas').getBody().style.cursor = ''; document.body.style.cursor = ''; + if(model && model.get('activeOnRender')){ + model.trigger('active'); + model.set('activeOnRender', 0); + } }, /** diff --git a/src/dom_components/view/ComponentImageView.js b/src/dom_components/view/ComponentImageView.js index 34d471a88..94e236db3 100644 --- a/src/dom_components/view/ComponentImageView.js +++ b/src/dom_components/view/ComponentImageView.js @@ -11,8 +11,8 @@ define(['backbone', './ComponentView'], initialize: function(o){ ComponentView.prototype.initialize.apply(this, arguments); - this.listenTo( this.model, 'change:src', this.updateSrc); - this.listenTo( this.model, 'dblclick', this.openModal); + this.listenTo( this.model, 'change:src', this.updateSrc); + this.listenTo( this.model, 'dblclick active', this.openModal); this.classEmpty = this.ppfx + 'plh-image'; if(this.config.modal) @@ -61,6 +61,8 @@ define(['backbone', './ComponentView'], if(!this.model.get('src')) this.$el.attr('class', this.classEmpty); + // Avoid strange behaviours while try to drag + this.$el.attr('onmousedown', 'return false'); return this; }, }); diff --git a/src/dom_components/view/ComponentTextView.js b/src/dom_components/view/ComponentTextView.js index 782225f99..929e1b70f 100644 --- a/src/dom_components/view/ComponentTextView.js +++ b/src/dom_components/view/ComponentTextView.js @@ -10,7 +10,7 @@ define(['backbone', './ComponentView'], initialize: function(o){ ComponentView.prototype.initialize.apply(this, arguments); _.bindAll(this,'disableEditing'); - this.listenTo(this.model, 'focus', this.enableEditing); + this.listenTo(this.model, 'focus active', this.enableEditing); this.rte = this.config.rte || ''; }, diff --git a/src/editor/config/config.js b/src/editor/config/config.js index c8fbf3fef..351e978e3 100644 --- a/src/editor/config/config.js +++ b/src/editor/config/config.js @@ -110,7 +110,24 @@ define(function () { },{ id: 'b3', label: 'Block3', - content: '