@concretecms/bedrock 1.4.15 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -68,6 +68,10 @@ export default {
|
|
|
68
68
|
type: Number,
|
|
69
69
|
required: false,
|
|
70
70
|
default: null
|
|
71
|
+
},
|
|
72
|
+
reloadOnReplace: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false
|
|
71
75
|
}
|
|
72
76
|
},
|
|
73
77
|
computed: {
|
|
@@ -274,6 +278,10 @@ export default {
|
|
|
274
278
|
this.dropzone.processQueue()
|
|
275
279
|
},
|
|
276
280
|
uploadComplete(fileIds) {
|
|
281
|
+
if (this.replaceFileId && fileIds && fileIds.length && this.reloadOnReplace) {
|
|
282
|
+
window.location.reload()
|
|
283
|
+
return
|
|
284
|
+
}
|
|
277
285
|
this.$emit('upload-complete', fileIds)
|
|
278
286
|
|
|
279
287
|
ConcreteAlert.notify({
|
package/assets/cms/js/tree.js
CHANGED
|
@@ -138,11 +138,11 @@ ConcreteTree.prototype = {
|
|
|
138
138
|
},
|
|
139
139
|
select: function (select, data) {
|
|
140
140
|
if (options.chooseNodeInForm) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
})
|
|
141
|
+
const keys = my.getSelectedNodeKeys(data.tree.getRootNode(), ajaxData.treeNodeSelectedIDs)
|
|
142
|
+
if (keys.length) {
|
|
144
143
|
options.onSelect(keys)
|
|
145
144
|
}
|
|
145
|
+
}
|
|
146
146
|
},
|
|
147
147
|
|
|
148
148
|
selectMode: selectMode,
|
|
@@ -168,12 +168,9 @@ ConcreteTree.prototype = {
|
|
|
168
168
|
|
|
169
169
|
var selectedNodes
|
|
170
170
|
if (options.chooseNodeInForm) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
var keys = $.map(selectedNodes, function (node) {
|
|
175
|
-
return node.key
|
|
176
|
-
})
|
|
171
|
+
const tree = $.ui.fancytree.getTree($tree)
|
|
172
|
+
const keys = my.getSelectedNodeKeys(tree.getRootNode(), ajaxData.treeNodeSelectedIDs)
|
|
173
|
+
if (keys.length) {
|
|
177
174
|
options.onSelect(keys)
|
|
178
175
|
}
|
|
179
176
|
}
|
|
@@ -310,6 +307,30 @@ ConcreteTree.prototype = {
|
|
|
310
307
|
})
|
|
311
308
|
},
|
|
312
309
|
|
|
310
|
+
getSelectedNodeKeys: function (node, selected) {
|
|
311
|
+
var my = this
|
|
312
|
+
|
|
313
|
+
// Initialize selected and deselected arrays
|
|
314
|
+
selected = selected || []
|
|
315
|
+
// Walk through all child nodes
|
|
316
|
+
if (node.hasChildren()) {
|
|
317
|
+
node.getChildren().forEach(function (child) {
|
|
318
|
+
// If the node is selected and not already in the selected array, add it
|
|
319
|
+
if (child.isSelected() && !selected.includes(parseInt(child.key))) {
|
|
320
|
+
selected.push(parseInt(child.key))
|
|
321
|
+
}
|
|
322
|
+
// If the node is not selected and is in the selected array, remove it
|
|
323
|
+
if (!child.isSelected() && selected.includes(parseInt(child.key))) {
|
|
324
|
+
selected.splice(selected.indexOf(parseInt(child.key)), 1)
|
|
325
|
+
}
|
|
326
|
+
// call the function recursively and merge the result with the selected array
|
|
327
|
+
selected = my.getSelectedNodeKeys(child, selected)
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return selected
|
|
332
|
+
},
|
|
333
|
+
|
|
313
334
|
getLoadNodePromise: function (node) {
|
|
314
335
|
var my = this
|
|
315
336
|
var ajaxData = my.options.ajaxData != false ? my.options.ajaxData : {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@concretecms/bedrock",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "The asset framework and dependencies for Concrete CMS.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "standardx \"**/*.{js,vue}\" && stylelint assets/**/*.{scss,vue}",
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
"storybook": "start-storybook -p55600 -s./.storybook/public"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@concretecms/bedrock": "^1.4.13",
|
|
16
15
|
"@fortawesome/fontawesome-free": "^5.15.1",
|
|
17
16
|
"ace-builds": "^1.4.12",
|
|
18
17
|
"ajax-bootstrap-select": "^1.4.5",
|
|
19
18
|
"backstretch": "^1.2.2",
|
|
20
19
|
"blueimp-file-upload": "^10.31.0",
|
|
21
20
|
"bootbox": "github:makeusabrew/bootbox#master",
|
|
22
|
-
"bootstrap": "5.
|
|
21
|
+
"bootstrap": "5.3.3",
|
|
23
22
|
"bootstrap-select": "github:snapappointments/bootstrap-select",
|
|
24
23
|
"bootstrap-tourist": "git+https://git@github.com/concrete5/bootstrap-tourist.git",
|
|
25
24
|
"check-password-strength": "^2.0.7",
|