Skip to content

Commit 7b70347

Browse files
authored
Merge pull request #1277 from neomjs/dev
v1.4.20
2 parents 3def949 + da5e369 commit 7b70347

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neo.mjs",
3-
"version": "1.4.19",
3+
"version": "1.4.20",
44
"description": "The webworkers driven UI framework",
55
"repository": {
66
"type": "git",

src/draggable/DragZone.mjs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DragZone extends Base {
5454
/**
5555
* @member {Object|null} dragProxyConfig=null
5656
*/
57-
dragProxyConfig: null,
57+
dragProxyConfig_: null,
5858
/**
5959
* @member {Boolean} moveHorizontal=true
6060
*/
@@ -114,13 +114,25 @@ class DragZone extends Base {
114114
}
115115
}
116116

117+
/**
118+
* Triggered when accessing the dragProxyConfig config
119+
* We are re-using this config to create multiple dragProxies,
120+
* so it is important to work with a clone. see: createDragProxy()
121+
* @param {Object} value
122+
* @protected
123+
*/
124+
beforeGetDragProxyConfig(value) {
125+
return Neo.clone(value, true, true);
126+
}
127+
117128
/**
118129
*
119130
* @param {Object} data
120131
*/
121132
createDragProxy(data) {
122-
let me = this,
123-
clone = VDomUtil.clone(me.dragElement);
133+
let me = this,
134+
component = Neo.getComponent(me.dragElement.id),
135+
clone = VDomUtil.clone(me.dragElement);
124136

125137
const config = {
126138
module : DragProxyComponent,
@@ -139,8 +151,14 @@ class DragZone extends Base {
139151
...me.dragProxyConfig || {}
140152
};
141153

154+
config.cls = config.cls || [];
155+
156+
if (component) {
157+
config.cls.push(component.getTheme());
158+
}
159+
142160
if (!me.useProxyWrapper) {
143-
config.cls = clone.cls;
161+
config.cls.push(...clone.cls);
144162
}
145163

146164
me.dragProxy = Neo.create(config);

0 commit comments

Comments
 (0)