easy-file-system 2.1.92 → 2.1.95
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.
- package/example.js +27 -62
- package/lib/explorer.js +18 -32
- package/lib/item/entry/drag.js +8 -21
- package/lib/span/name.js +3 -11
- package/package.json +1 -1
- package/src/explorer.js +14 -35
- package/src/item/entry/drag.js +11 -25
- package/src/span/name.js +2 -11
package/src/item/entry/drag.js
CHANGED
|
@@ -45,15 +45,9 @@ class DragEntryItem extends EntryItem {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
startDragHandler = (element) => {
|
|
48
|
-
const explorer = this.getExplorer(),
|
|
49
|
-
editing = explorer.isEditing();
|
|
50
|
-
|
|
51
|
-
if (editing) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
48
|
const path = this.getPath(),
|
|
56
49
|
type = this.getType(),
|
|
50
|
+
explorer = this.getExplorer(),
|
|
57
51
|
dragEntryItemType = type, ///
|
|
58
52
|
markerEntryItemPath = path; ///
|
|
59
53
|
|
|
@@ -164,13 +158,6 @@ class DragEntryItem extends EntryItem {
|
|
|
164
158
|
return created;
|
|
165
159
|
}
|
|
166
160
|
|
|
167
|
-
isEditing() {
|
|
168
|
-
const nameSpanEditing = this.isNameSpanEditing(),
|
|
169
|
-
editing = nameSpanEditing; ///
|
|
170
|
-
|
|
171
|
-
return editing;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
161
|
isSelected() {
|
|
175
162
|
const selected = this.hasClass("selected"); ///
|
|
176
163
|
|
|
@@ -199,17 +186,13 @@ class DragEntryItem extends EntryItem {
|
|
|
199
186
|
}
|
|
200
187
|
|
|
201
188
|
edit() {
|
|
202
|
-
const explorer = this.getExplorer(),
|
|
203
|
-
editing = explorer.isEditing();
|
|
204
|
-
|
|
205
|
-
if (editing) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
189
|
const name = this.getName(),
|
|
210
190
|
created = false,
|
|
191
|
+
explorer = this.getExplorer(),
|
|
211
192
|
nameSpanName = name; ///
|
|
212
193
|
|
|
194
|
+
explorer.disable();
|
|
195
|
+
|
|
213
196
|
this.setCreated(created);
|
|
214
197
|
|
|
215
198
|
this.setNameSpanName(nameSpanName);
|
|
@@ -220,13 +203,16 @@ class DragEntryItem extends EntryItem {
|
|
|
220
203
|
}
|
|
221
204
|
|
|
222
205
|
reset() {
|
|
223
|
-
const created = this.isCreated()
|
|
206
|
+
const created = this.isCreated(),
|
|
207
|
+
explorer = this.getExplorer();
|
|
224
208
|
|
|
225
|
-
|
|
209
|
+
explorer.enable();
|
|
226
210
|
|
|
227
|
-
this.
|
|
211
|
+
this.cancelNameSpan();
|
|
228
212
|
|
|
229
213
|
this.setCreated(created);
|
|
214
|
+
|
|
215
|
+
this.enableDrag();
|
|
230
216
|
}
|
|
231
217
|
|
|
232
218
|
cancel() {
|
|
@@ -299,7 +285,7 @@ Object.assign(EntryItem.prototype, dragMixins);
|
|
|
299
285
|
export default withStyle(DragEntryItem)`
|
|
300
286
|
|
|
301
287
|
user-select: none;
|
|
302
|
-
|
|
288
|
+
|
|
303
289
|
font-weight: normal;
|
|
304
290
|
|
|
305
291
|
.selected {
|
package/src/span/name.js
CHANGED
|
@@ -29,13 +29,6 @@ class NameSpan extends Element {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
isEditing() {
|
|
33
|
-
const contentEditable = this.hasAttribute(CONTENT_EDITABLE),
|
|
34
|
-
editing = contentEditable; ///
|
|
35
|
-
|
|
36
|
-
return editing;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
32
|
getName() {
|
|
40
33
|
const html = this.html(),
|
|
41
34
|
name = html; ///
|
|
@@ -91,8 +84,7 @@ class NameSpan extends Element {
|
|
|
91
84
|
onNameSpanChange = this.onChange.bind(this), ///
|
|
92
85
|
onNameSpanCancel = this.onCancel.bind(this), ///
|
|
93
86
|
offNameSpanChange = this.offChange.bind(this), ///
|
|
94
|
-
offNameSpanCancel = this.offCancel.bind(this)
|
|
95
|
-
isNameSpanEditing = this.isEditing.bind(this); ///
|
|
87
|
+
offNameSpanCancel = this.offCancel.bind(this); ///
|
|
96
88
|
|
|
97
89
|
return ({
|
|
98
90
|
editNameSpan,
|
|
@@ -102,8 +94,7 @@ class NameSpan extends Element {
|
|
|
102
94
|
onNameSpanChange,
|
|
103
95
|
onNameSpanCancel,
|
|
104
96
|
offNameSpanChange,
|
|
105
|
-
offNameSpanCancel
|
|
106
|
-
isNameSpanEditing
|
|
97
|
+
offNameSpanCancel
|
|
107
98
|
});
|
|
108
99
|
}
|
|
109
100
|
|