From 283321178c5e1af9e19677aec8f257e20034896e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 13 Aug 2019 14:54:20 +0200 Subject: [PATCH] Add `setDragMode` method to the component --- src/dom_components/model/Component.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 41a029861..90b16eae9 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -229,6 +229,16 @@ const Component = Backbone.Model.extend(Styleable).extend( return collection && collection.indexOf(this); }, + /** + * Change the drag mode of the component. + * To get more about this feature read: https://github.com/artf/grapesjs/issues/1936 + * @param {String} value Drag mode, options: 'absolute' | 'translate' + * @returns {this} + */ + setDragMode(value) { + return this.set('dmode', value); + }, + /** * Find inner components by query string. * **ATTENTION**: this method works only with already rendered component