easy-file-system 2.1.258 → 2.1.262

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/src/span/name.js CHANGED
@@ -63,6 +63,8 @@ class NameSpan extends Element {
63
63
 
64
64
  this.addAttribute(CONTENT_EDITABLE, TRUE);
65
65
 
66
+ this.onKeyDown(this.keyDownHandler);
67
+
66
68
  const html = this.html(),
67
69
  range = document.createRange(),
68
70
  selection = window.getSelection(),
@@ -79,8 +81,6 @@ class NameSpan extends Element {
79
81
  selection.removeAllRanges();
80
82
 
81
83
  selection.addRange(range);
82
-
83
- this.onKeyDown(this.keyDownHandler);
84
84
  }
85
85
 
86
86
  reset() {
@@ -89,14 +89,22 @@ class NameSpan extends Element {
89
89
  this.removeAttribute(CONTENT_EDITABLE, TRUE);
90
90
  }
91
91
 
92
+ isEditable() {
93
+ const contentEditableAttribute = this.hasAttribute(CONTENT_EDITABLE),
94
+ editable = contentEditableAttribute; ///
95
+
96
+ return editable;
97
+ }
98
+
92
99
  parentContext() {
93
100
  const editNameSpan = this.edit.bind(this), ///
94
101
  resetNameSpan = this.reset.bind(this), ///
95
102
  getNameSpanName = this.getName.bind(this), ///
96
103
  setNameSpanName = this.setName.bind(this), ///
104
+ isNameSpanEditable = this.isEditable.bind(this), ///
97
105
  onCustomNameSpanCancel = this.onCustomCancel.bind(this), ///
98
- offCustomNameSpanCancel = this.offCustomCancel.bind(this), ///
99
106
  onCustomNameSpanChange = this.onCustomChange.bind(this), ///
107
+ offCustomNameSpanCancel = this.offCustomCancel.bind(this), ///
100
108
  offCustomNameSpanChange = this.offCustomChange.bind(this); ///
101
109
 
102
110
  return ({
@@ -104,9 +112,10 @@ class NameSpan extends Element {
104
112
  resetNameSpan,
105
113
  getNameSpanName,
106
114
  setNameSpanName,
115
+ isNameSpanEditable,
107
116
  onCustomNameSpanCancel,
108
- offCustomNameSpanCancel,
109
117
  onCustomNameSpanChange,
118
+ offCustomNameSpanCancel,
110
119
  offCustomNameSpanChange
111
120
  });
112
121
  }