neo.mjs 4.3.9 → 4.3.11
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/README.md +1 -1
- package/apps/covid/view/MainContainerController.mjs +9 -11
- package/apps/krausest/view/MainComponent.mjs +3 -4
- package/apps/krausest/view/TableComponent.mjs +2 -3
- package/apps/realworld/view/HeaderComponent.mjs +7 -10
- package/apps/realworld/view/HomeComponent.mjs +16 -24
- package/apps/realworld/view/MainContainerController.mjs +3 -3
- package/apps/realworld/view/article/CommentComponent.mjs +11 -19
- package/apps/realworld/view/article/Component.mjs +20 -36
- package/apps/realworld/view/article/CreateCommentComponent.mjs +9 -16
- package/apps/realworld/view/article/CreateComponent.mjs +12 -20
- package/apps/realworld/view/article/PreviewComponent.mjs +16 -30
- package/apps/realworld/view/article/TagListComponent.mjs +4 -5
- package/apps/realworld/view/user/ProfileComponent.mjs +14 -21
- package/apps/realworld/view/user/SettingsComponent.mjs +9 -16
- package/apps/realworld/view/user/SignUpComponent.mjs +6 -9
- package/apps/realworld2/view/MainContainerController.mjs +2 -2
- package/apps/realworld2/view/article/PreviewComponent.mjs +17 -31
- package/apps/realworld2/view/article/PreviewList.mjs +4 -7
- package/apps/realworld2/view/article/TagListComponent.mjs +4 -5
- package/apps/sharedcovid/view/MainContainerController.mjs +10 -13
- package/apps/website/data/blog.json +1 -1
- package/apps/website/view/blog/List.mjs +2 -3
- package/buildScripts/injectPackageVersion.mjs +43 -0
- package/docs/app/view/ApiTreeList.mjs +2 -6
- package/docs/app/view/ExamplesTreeList.mjs +2 -6
- package/docs/app/view/TutorialsTreeList.mjs +2 -6
- package/docs/app/view/classdetails/HeaderComponent.mjs +3 -4
- package/docs/app/view/classdetails/HierarchyTreeList.mjs +1 -2
- package/docs/app/view/classdetails/MembersList.mjs +4 -6
- package/docs/app/view/classdetails/SourceViewComponent.mjs +3 -6
- package/docs/app/view/classdetails/TutorialComponent.mjs +4 -5
- package/examples/component/coronaGallery/CountryGallery.mjs +36 -59
- package/examples/form/field/date/MainContainer.mjs +1 -1
- package/examples/tabs/MainContainer.mjs +4 -6
- package/examples/todoList/version1/MainComponent.mjs +5 -7
- package/examples/todoList/version2/TodoList.mjs +4 -5
- package/package.json +8 -7
- package/resources/scss/src/draggable/tree/DragZone.scss +3 -1
- package/src/DefaultConfig.mjs +9 -1
- package/src/button/Base.mjs +18 -27
- package/src/button/Split.mjs +3 -4
- package/src/calendar/view/MainContainer.mjs +3 -5
- package/src/calendar/view/SettingsContainer.mjs +3 -5
- package/src/calendar/view/YearComponent.mjs +7 -9
- package/src/calendar/view/month/Component.mjs +7 -12
- package/src/calendar/view/week/Component.mjs +2 -3
- package/src/calendar/view/week/TimeAxisComponent.mjs +0 -3
- package/src/component/Base.mjs +37 -55
- package/src/component/Carousel.mjs +5 -9
- package/src/component/Chip.mjs +6 -12
- package/src/component/Circle.mjs +16 -22
- package/src/component/Clock.mjs +1 -1
- package/src/component/DateSelector.mjs +4 -9
- package/src/component/Gallery.mjs +12 -21
- package/src/component/Helix.mjs +2 -3
- package/src/component/Label.mjs +2 -3
- package/src/component/Legend.mjs +6 -9
- package/src/container/Base.mjs +5 -9
- package/src/container/Panel.mjs +4 -0
- package/src/dialog/Base.mjs +40 -42
- package/src/dialog/header/Toolbar.mjs +105 -0
- package/src/draggable/list/DragZone.mjs +1 -2
- package/src/draggable/tree/DragZone.mjs +1 -2
- package/src/form/Fieldset.mjs +4 -6
- package/src/form/field/CheckBox.mjs +23 -39
- package/src/form/field/Color.mjs +2 -3
- package/src/form/field/Display.mjs +1 -2
- package/src/form/field/Number.mjs +1 -2
- package/src/form/field/Picker.mjs +0 -1
- package/src/form/field/Text.mjs +40 -57
- package/src/form/field/TextArea.mjs +2 -3
- package/src/form/field/trigger/Base.mjs +2 -3
- package/src/form/field/trigger/SpinUpDown.mjs +3 -4
- package/src/form/field/trigger/Time.mjs +3 -4
- package/src/grid/View.mjs +2 -2
- package/src/grid/header/Toolbar.mjs +1 -2
- package/src/layout/Card.mjs +2 -2
- package/src/list/Base.mjs +6 -11
- package/src/list/plugin/Animate.mjs +5 -12
- package/src/plugin/Resizable.mjs +3 -6
- package/src/selection/Model.mjs +3 -7
- package/src/selection/grid/CellColumnModel.mjs +2 -5
- package/src/selection/grid/CellColumnRowModel.mjs +2 -5
- package/src/selection/grid/CellRowModel.mjs +4 -13
- package/src/selection/table/CellColumnModel.mjs +2 -5
- package/src/selection/table/CellColumnRowModel.mjs +2 -5
- package/src/selection/table/CellRowModel.mjs +4 -13
- package/src/sitemap/Component.mjs +1 -1
- package/src/tab/Strip.mjs +8 -11
- package/src/tab/header/Toolbar.mjs +2 -3
- package/src/table/View.mjs +3 -3
- package/src/table/header/Button.mjs +4 -6
- package/src/table/header/Toolbar.mjs +3 -5
- package/src/tree/List.mjs +6 -9
@@ -98,10 +98,8 @@ class CreateComponent extends Component {
|
|
98
98
|
* @protected
|
99
99
|
*/
|
100
100
|
afterSetBody(value, oldValue) {
|
101
|
-
|
102
|
-
|
103
|
-
VDomUtil.getByFlag(vdom, 'body').value = value;
|
104
|
-
this.vdom = vdom;
|
101
|
+
VDomUtil.getByFlag(this.vdom, 'body').value = value;
|
102
|
+
this.update();
|
105
103
|
}
|
106
104
|
|
107
105
|
/**
|
@@ -111,10 +109,8 @@ class CreateComponent extends Component {
|
|
111
109
|
* @protected
|
112
110
|
*/
|
113
111
|
afterSetDescription(value, oldValue) {
|
114
|
-
|
115
|
-
|
116
|
-
VDomUtil.getByFlag(vdom, 'description').value = value;
|
117
|
-
this.vdom = vdom;
|
112
|
+
VDomUtil.getByFlag(this.vdom, 'description').value = value;
|
113
|
+
this.update();
|
118
114
|
}
|
119
115
|
|
120
116
|
/**
|
@@ -125,8 +121,7 @@ class CreateComponent extends Component {
|
|
125
121
|
*/
|
126
122
|
afterSetErrors(value, oldValue) {
|
127
123
|
let me = this,
|
128
|
-
|
129
|
-
list = VDomUtil.getByFlag(vdom, 'errors');
|
124
|
+
list = VDomUtil.getByFlag(me.vdom, 'errors');
|
130
125
|
|
131
126
|
list.cn = [];
|
132
127
|
|
@@ -137,7 +132,7 @@ class CreateComponent extends Component {
|
|
137
132
|
});
|
138
133
|
});
|
139
134
|
|
140
|
-
me.
|
135
|
+
me.update();
|
141
136
|
}
|
142
137
|
|
143
138
|
/**
|
@@ -148,9 +143,8 @@ class CreateComponent extends Component {
|
|
148
143
|
*/
|
149
144
|
afterSetTagList(value, oldValue) {
|
150
145
|
let me = this,
|
151
|
-
|
152
|
-
|
153
|
-
tagField = VDomUtil.getByFlag(vdom, 'tags');
|
146
|
+
list = VDomUtil.getByFlag(me.vdom, 'tag-list'),
|
147
|
+
tagField = VDomUtil.getByFlag(me.vdom, 'tags');
|
154
148
|
|
155
149
|
list.cn = [];
|
156
150
|
tagField.value = null; // TODO Reset tag field value properly
|
@@ -170,7 +164,7 @@ class CreateComponent extends Component {
|
|
170
164
|
});
|
171
165
|
});
|
172
166
|
|
173
|
-
me.
|
167
|
+
me.update();
|
174
168
|
}
|
175
169
|
|
176
170
|
/**
|
@@ -180,10 +174,8 @@ class CreateComponent extends Component {
|
|
180
174
|
* @protected
|
181
175
|
*/
|
182
176
|
afterSetTitle(value, oldValue) {
|
183
|
-
|
184
|
-
|
185
|
-
VDomUtil.getByFlag(vdom, 'title').value = value;
|
186
|
-
this.vdom = vdom;
|
177
|
+
VDomUtil.getByFlag(this.vdom, 'title').value = value;
|
178
|
+
this.update();
|
187
179
|
}
|
188
180
|
|
189
181
|
/**
|
@@ -191,7 +183,7 @@ class CreateComponent extends Component {
|
|
191
183
|
* @param event
|
192
184
|
*/
|
193
185
|
onFieldTagsKeyDown(event) {
|
194
|
-
|
186
|
+
let me = this;
|
195
187
|
|
196
188
|
if (event.key === 'Enter') {
|
197
189
|
Neo.main.DomAccess.getAttributes({
|
@@ -110,8 +110,7 @@ class PreviewComponent extends Component {
|
|
110
110
|
node.html = value;
|
111
111
|
|
112
112
|
VDomUtil.getByFlag(vdom, 'userImageLink').href = href;
|
113
|
-
|
114
|
-
this.vdom = vdom;
|
113
|
+
this.update();
|
115
114
|
}
|
116
115
|
|
117
116
|
/**
|
@@ -121,15 +120,13 @@ class PreviewComponent extends Component {
|
|
121
120
|
* @protected
|
122
121
|
*/
|
123
122
|
afterSetCreatedAt(value, oldValue) {
|
124
|
-
|
125
|
-
|
126
|
-
VDomUtil.getByFlag(vdom, 'createdAt').html = new Intl.DateTimeFormat('en-US', {
|
123
|
+
VDomUtil.getByFlag(this.vdom, 'createdAt').html = new Intl.DateTimeFormat('en-US', {
|
127
124
|
day : 'numeric',
|
128
125
|
month: 'long',
|
129
126
|
year : 'numeric'
|
130
127
|
}).format(new Date(value));
|
131
128
|
|
132
|
-
this.
|
129
|
+
this.update();
|
133
130
|
}
|
134
131
|
|
135
132
|
/**
|
@@ -139,10 +136,8 @@ class PreviewComponent extends Component {
|
|
139
136
|
* @protected
|
140
137
|
*/
|
141
138
|
afterSetDescription(value, oldValue) {
|
142
|
-
|
143
|
-
|
144
|
-
VDomUtil.getByFlag(vdom, 'description').html = value;
|
145
|
-
this.vdom = vdom;
|
139
|
+
VDomUtil.getByFlag(this.vdom, 'description').html = value;
|
140
|
+
this.update();
|
146
141
|
}
|
147
142
|
|
148
143
|
/**
|
@@ -153,13 +148,12 @@ class PreviewComponent extends Component {
|
|
153
148
|
*/
|
154
149
|
afterSetFavorited(value, oldValue) {
|
155
150
|
let me = this,
|
156
|
-
|
157
|
-
button = vdom.cn[0].cn[2];
|
151
|
+
button = me.vdom.cn[0].cn[2];
|
158
152
|
|
159
153
|
NeoArray.add(button.cls, value ? 'btn-primary' : 'btn-outline-primary');
|
160
154
|
NeoArray.remove(button.cls, value ? 'btn-outline-primary' : 'btn-primary');
|
161
155
|
|
162
|
-
me.
|
156
|
+
me.update();
|
163
157
|
|
164
158
|
// ignore the initial setter call
|
165
159
|
if (Neo.isBoolean(oldValue)) {
|
@@ -174,10 +168,8 @@ class PreviewComponent extends Component {
|
|
174
168
|
* @protected
|
175
169
|
*/
|
176
170
|
afterSetFavoritesCount(value, oldValue) {
|
177
|
-
|
178
|
-
|
179
|
-
VDomUtil.getByFlag(vdom, 'favoritesCount').html = ' ' + value;
|
180
|
-
this.vdom = vdom;
|
171
|
+
VDomUtil.getByFlag(this.vdom, 'favoritesCount').html = ' ' + value;
|
172
|
+
this.update();
|
181
173
|
}
|
182
174
|
|
183
175
|
/**
|
@@ -187,10 +179,8 @@ class PreviewComponent extends Component {
|
|
187
179
|
* @protected
|
188
180
|
*/
|
189
181
|
afterSetSlug(value, oldValue) {
|
190
|
-
|
191
|
-
|
192
|
-
VDomUtil.getByFlag(vdom, 'preview-link').href = '#/article/' + value;
|
193
|
-
this.vdom = vdom;
|
182
|
+
VDomUtil.getByFlag(this.vdom, 'preview-link').href = '#/article/' + value;
|
183
|
+
this.update();
|
194
184
|
}
|
195
185
|
|
196
186
|
/**
|
@@ -226,7 +216,7 @@ class PreviewComponent extends Component {
|
|
226
216
|
|
227
217
|
vdom.cn[1].cn.push(tagList);
|
228
218
|
|
229
|
-
me.
|
219
|
+
me.update();
|
230
220
|
}
|
231
221
|
}
|
232
222
|
|
@@ -237,10 +227,8 @@ class PreviewComponent extends Component {
|
|
237
227
|
* @protected
|
238
228
|
*/
|
239
229
|
afterSetTitle(value, oldValue) {
|
240
|
-
|
241
|
-
|
242
|
-
VDomUtil.getByFlag(vdom, 'title').html = value;
|
243
|
-
this.vdom = vdom;
|
230
|
+
VDomUtil.getByFlag(this.vdom, 'title').html = value;
|
231
|
+
this.update();
|
244
232
|
}
|
245
233
|
|
246
234
|
/**
|
@@ -250,10 +238,8 @@ class PreviewComponent extends Component {
|
|
250
238
|
* @protected
|
251
239
|
*/
|
252
240
|
afterSetUserImage(value, oldValue) {
|
253
|
-
|
254
|
-
|
255
|
-
VDomUtil.getByFlag(vdom, 'userImageLink').cn[0].src = value;
|
256
|
-
this.vdom = vdom;
|
241
|
+
VDomUtil.getByFlag(this.vdom, 'userImageLink').cn[0].src = value;
|
242
|
+
this.update();
|
257
243
|
}
|
258
244
|
|
259
245
|
/**
|
@@ -88,14 +88,13 @@ class TagListComponent extends Component {
|
|
88
88
|
* @protected
|
89
89
|
*/
|
90
90
|
afterSetTags(value, oldValue) {
|
91
|
-
let me
|
92
|
-
vdom = me.vdom;
|
91
|
+
let me = this;
|
93
92
|
|
94
|
-
vdom.cn[0].cn[1].cn = [];
|
93
|
+
me.vdom.cn[0].cn[1].cn = [];
|
95
94
|
|
96
95
|
if (Array.isArray(value)) {
|
97
96
|
value.forEach(item => {
|
98
|
-
vdom.cn[0].cn[1].cn.push({
|
97
|
+
me.vdom.cn[0].cn[1].cn.push({
|
99
98
|
tag : 'a',
|
100
99
|
cls : ['tag-pill', 'tag-default'],
|
101
100
|
href: '',
|
@@ -104,7 +103,7 @@ class TagListComponent extends Component {
|
|
104
103
|
});
|
105
104
|
});
|
106
105
|
|
107
|
-
me.
|
106
|
+
me.update();
|
108
107
|
}
|
109
108
|
}
|
110
109
|
|
@@ -126,8 +126,7 @@ class ProfileComponent extends Component {
|
|
126
126
|
*/
|
127
127
|
afterSetArticlePreviews(value, oldValue) {
|
128
128
|
let me = this,
|
129
|
-
|
130
|
-
container = VDomUtil.getByFlag(vdom, 'feed-container'),
|
129
|
+
container = VDomUtil.getByFlag(me.vdom, 'feed-container'),
|
131
130
|
config;
|
132
131
|
|
133
132
|
container.cn = [container.cn.shift()];
|
@@ -160,7 +159,7 @@ class ProfileComponent extends Component {
|
|
160
159
|
});
|
161
160
|
}
|
162
161
|
|
163
|
-
me.
|
162
|
+
me.update();
|
164
163
|
}
|
165
164
|
|
166
165
|
/**
|
@@ -171,10 +170,8 @@ class ProfileComponent extends Component {
|
|
171
170
|
*/
|
172
171
|
afterSetBio(value, oldValue) {
|
173
172
|
if (value) {
|
174
|
-
|
175
|
-
|
176
|
-
VDomUtil.getByFlag(vdom, 'bio').html = value;
|
177
|
-
this.vdom = vdom;
|
173
|
+
VDomUtil.getByFlag(this.vdom, 'bio').html = value;
|
174
|
+
this.update();
|
178
175
|
}
|
179
176
|
}
|
180
177
|
|
@@ -186,8 +183,7 @@ class ProfileComponent extends Component {
|
|
186
183
|
*/
|
187
184
|
afterSetFollowing(value, oldValue) {
|
188
185
|
if (Neo.isBoolean(value)) {
|
189
|
-
let
|
190
|
-
node = VDomUtil.getByFlag(vdom, 'following');
|
186
|
+
let node = VDomUtil.getByFlag(this.vdom, 'following');
|
191
187
|
|
192
188
|
// tobiu: did not see this one in the specs, but the react & vue app do it
|
193
189
|
NeoArray.remove(node.cls, value ? 'btn-outline-secondary' : 'btn-secondary');
|
@@ -195,7 +191,7 @@ class ProfileComponent extends Component {
|
|
195
191
|
|
196
192
|
node.cn[0].cls = [value ? 'ion-minus-round' : 'ion-plus-round'];
|
197
193
|
node.cn[1].html = value ? ' Unfollow ' : ' Follow ';
|
198
|
-
this.
|
194
|
+
this.update();
|
199
195
|
}
|
200
196
|
}
|
201
197
|
|
@@ -206,10 +202,8 @@ class ProfileComponent extends Component {
|
|
206
202
|
* @protected
|
207
203
|
*/
|
208
204
|
afterSetImage(value, oldValue) {
|
209
|
-
|
210
|
-
|
211
|
-
VDomUtil.getByFlag(vdom, 'image').src = value;
|
212
|
-
this.vdom = vdom;
|
205
|
+
VDomUtil.getByFlag(this.vdom, 'image').src = value;
|
206
|
+
this.update();
|
213
207
|
}
|
214
208
|
|
215
209
|
/**
|
@@ -224,7 +218,7 @@ class ProfileComponent extends Component {
|
|
224
218
|
|
225
219
|
VDomUtil.getByFlag(vdom, 'edit-profile').removeDom = !value;
|
226
220
|
VDomUtil.getByFlag(vdom, 'following') .removeDom = value;
|
227
|
-
this.
|
221
|
+
this.update();
|
228
222
|
}
|
229
223
|
}
|
230
224
|
|
@@ -239,7 +233,7 @@ class ProfileComponent extends Component {
|
|
239
233
|
|
240
234
|
VDomUtil.getByFlag(vdom, 'following').cn[2].html = value;
|
241
235
|
VDomUtil.getByFlag(vdom, 'username').html = value;
|
242
|
-
this.
|
236
|
+
this.update();
|
243
237
|
}
|
244
238
|
|
245
239
|
/**
|
@@ -274,9 +268,8 @@ class ProfileComponent extends Component {
|
|
274
268
|
*/
|
275
269
|
onNavLinkClick(data) {
|
276
270
|
let me = this,
|
277
|
-
|
278
|
-
|
279
|
-
feedHeader = VDomUtil.getByFlag(vdom, 'feed-header'),
|
271
|
+
el = VDomUtil.findVdomChild(me.vdom, data.path[0].id),
|
272
|
+
feedHeader = VDomUtil.getByFlag(me.vdom, 'feed-header'),
|
280
273
|
params = {};
|
281
274
|
|
282
275
|
if (!el.vdom.cls.includes('disabled')) {
|
@@ -297,7 +290,7 @@ class ProfileComponent extends Component {
|
|
297
290
|
NeoArray[item.id === el.parentNode.id ? 'add' : 'remove'](item.cn[0].cls, 'active');
|
298
291
|
});
|
299
292
|
|
300
|
-
me.
|
293
|
+
me.update();
|
301
294
|
|
302
295
|
me.getArticles({
|
303
296
|
...params,
|
@@ -310,7 +303,7 @@ class ProfileComponent extends Component {
|
|
310
303
|
/**
|
311
304
|
* @param {Object} configs
|
312
305
|
*/
|
313
|
-
|
306
|
+
updateContent(configs) {
|
314
307
|
let me = this,
|
315
308
|
username = configs.username;
|
316
309
|
|
@@ -103,7 +103,7 @@ class SettingsComponent extends Component {
|
|
103
103
|
let vdom = this.vdom;
|
104
104
|
|
105
105
|
VDomUtil.getByFlag(vdom, 'bio').value = value;
|
106
|
-
this.
|
106
|
+
this.update();
|
107
107
|
}
|
108
108
|
|
109
109
|
/**
|
@@ -113,10 +113,8 @@ class SettingsComponent extends Component {
|
|
113
113
|
* @protected
|
114
114
|
*/
|
115
115
|
afterSetEmail(value, oldValue) {
|
116
|
-
|
117
|
-
|
118
|
-
VDomUtil.getByFlag(vdom, 'email').value = value;
|
119
|
-
this.vdom = vdom;
|
116
|
+
VDomUtil.getByFlag(this.vdom, 'email').value = value;
|
117
|
+
this.update();
|
120
118
|
}
|
121
119
|
|
122
120
|
/**
|
@@ -127,8 +125,7 @@ class SettingsComponent extends Component {
|
|
127
125
|
*/
|
128
126
|
afterSetErrors(value=[], oldValue) {
|
129
127
|
let me = this,
|
130
|
-
|
131
|
-
list = VDomUtil.getByFlag(vdom, 'errors');
|
128
|
+
list = VDomUtil.getByFlag(me.vdom, 'errors');
|
132
129
|
|
133
130
|
list.cn = [];
|
134
131
|
list.removeDom = value.length === 0;
|
@@ -140,7 +137,7 @@ class SettingsComponent extends Component {
|
|
140
137
|
});
|
141
138
|
});
|
142
139
|
|
143
|
-
me.
|
140
|
+
me.update();
|
144
141
|
}
|
145
142
|
|
146
143
|
/**
|
@@ -150,10 +147,8 @@ class SettingsComponent extends Component {
|
|
150
147
|
* @protected
|
151
148
|
*/
|
152
149
|
afterSetImage(value, oldValue) {
|
153
|
-
|
154
|
-
|
155
|
-
VDomUtil.getByFlag(vdom, 'image').value = value;
|
156
|
-
this.vdom = vdom;
|
150
|
+
VDomUtil.getByFlag(this.vdom, 'image').value = value;
|
151
|
+
this.update();
|
157
152
|
}
|
158
153
|
|
159
154
|
/**
|
@@ -163,10 +158,8 @@ class SettingsComponent extends Component {
|
|
163
158
|
* @protected
|
164
159
|
*/
|
165
160
|
afterSetUserName(value, oldValue) {
|
166
|
-
|
167
|
-
|
168
|
-
VDomUtil.getByFlag(vdom, 'userName').value = value;
|
169
|
-
this.vdom = vdom;
|
161
|
+
VDomUtil.getByFlag(this.vdom, 'userName').value = value;
|
162
|
+
this.update();
|
170
163
|
}
|
171
164
|
|
172
165
|
/**
|
@@ -86,8 +86,7 @@ class SignUpComponent extends Component {
|
|
86
86
|
*/
|
87
87
|
afterSetErrors(value, oldValue) {
|
88
88
|
let me = this,
|
89
|
-
list = me.getErrorMessagesList()
|
90
|
-
vdom = me.vdom;
|
89
|
+
list = me.getErrorMessagesList();
|
91
90
|
|
92
91
|
list.cn = [];
|
93
92
|
|
@@ -98,7 +97,7 @@ class SignUpComponent extends Component {
|
|
98
97
|
});
|
99
98
|
});
|
100
99
|
|
101
|
-
me.
|
100
|
+
me.update();
|
102
101
|
}
|
103
102
|
|
104
103
|
/**
|
@@ -109,8 +108,7 @@ class SignUpComponent extends Component {
|
|
109
108
|
*/
|
110
109
|
afterSetFieldsets(value, oldValue) {
|
111
110
|
let me = this,
|
112
|
-
|
113
|
-
form = vdom.cn[0].cn[0].cn[0].cn[3];
|
111
|
+
form = me.vdom.cn[0].cn[0].cn[0].cn[3];
|
114
112
|
|
115
113
|
// slice().reverse() => iterate backwards
|
116
114
|
value.slice().reverse().forEach(item => {
|
@@ -128,7 +126,7 @@ class SignUpComponent extends Component {
|
|
128
126
|
});
|
129
127
|
});
|
130
128
|
|
131
|
-
me.
|
129
|
+
me.update();
|
132
130
|
}
|
133
131
|
|
134
132
|
/**
|
@@ -140,8 +138,7 @@ class SignUpComponent extends Component {
|
|
140
138
|
afterSetMode(value, oldValue) {
|
141
139
|
let me = this,
|
142
140
|
isSignup = value === 'signup',
|
143
|
-
|
144
|
-
contentDiv = vdom.cn[0].cn[0].cn[0];
|
141
|
+
contentDiv = me.vdom.cn[0].cn[0].cn[0];
|
145
142
|
|
146
143
|
// vdom bulk update
|
147
144
|
contentDiv.cn[0].html = isSignup ? 'Sign up' : 'Sign in';
|
@@ -155,7 +152,7 @@ class SignUpComponent extends Component {
|
|
155
152
|
// submit button text
|
156
153
|
contentDiv.cn[3].cn[0].cn[3].html = isSignup ? 'Sign up' : 'Sign in';
|
157
154
|
|
158
|
-
me.
|
155
|
+
me.update();
|
159
156
|
}
|
160
157
|
|
161
158
|
/**
|
@@ -177,12 +177,12 @@ class MainContainerController extends ComponentController {
|
|
177
177
|
* @param {String} slug
|
178
178
|
*/
|
179
179
|
getProfile(slug) {
|
180
|
-
|
180
|
+
let me = this;
|
181
181
|
|
182
182
|
ProfileApi.get({
|
183
183
|
slug: slug
|
184
184
|
}).then(data => {
|
185
|
-
/*me.profileComponent.
|
185
|
+
/*me.profileComponent.updateContent({
|
186
186
|
...data.json.profile,
|
187
187
|
myProfile: data.json.profile.username === (me.currentUser && me.currentUser.username)
|
188
188
|
});*/
|
@@ -115,8 +115,7 @@ class PreviewComponent extends Component {
|
|
115
115
|
* @protected
|
116
116
|
*/
|
117
117
|
afterSetAuthor(value, oldValue) {
|
118
|
-
let
|
119
|
-
node = VDomUtil.getByFlag(vdom, 'author'),
|
118
|
+
let node = VDomUtil.getByFlag(this.vdom, 'author'),
|
120
119
|
href = '#/profile/' + value;
|
121
120
|
|
122
121
|
// todo: disabled until the new profile view is ready
|
@@ -125,7 +124,7 @@ class PreviewComponent extends Component {
|
|
125
124
|
|
126
125
|
//VDomUtil.getByFlag(vdom, 'userImageLink').href = href;
|
127
126
|
|
128
|
-
this.
|
127
|
+
this.update();
|
129
128
|
}
|
130
129
|
|
131
130
|
/**
|
@@ -135,15 +134,13 @@ class PreviewComponent extends Component {
|
|
135
134
|
* @protected
|
136
135
|
*/
|
137
136
|
afterSetCreatedAt(value, oldValue) {
|
138
|
-
|
139
|
-
|
140
|
-
VDomUtil.getByFlag(vdom, 'createdAt').html = new Intl.DateTimeFormat('en-US', {
|
137
|
+
VDomUtil.getByFlag(this.vdom, 'createdAt').html = new Intl.DateTimeFormat('en-US', {
|
141
138
|
day : 'numeric',
|
142
139
|
month: 'long',
|
143
140
|
year : 'numeric'
|
144
141
|
}).format(new Date(value));
|
145
142
|
|
146
|
-
this.
|
143
|
+
this.update();
|
147
144
|
}
|
148
145
|
|
149
146
|
/**
|
@@ -153,10 +150,8 @@ class PreviewComponent extends Component {
|
|
153
150
|
* @protected
|
154
151
|
*/
|
155
152
|
afterSetDescription(value, oldValue) {
|
156
|
-
|
157
|
-
|
158
|
-
VDomUtil.getByFlag(vdom, 'description').html = value;
|
159
|
-
this.vdom = vdom;
|
153
|
+
VDomUtil.getByFlag(this.vdom, 'description').html = value;
|
154
|
+
this.update();
|
160
155
|
}
|
161
156
|
|
162
157
|
/**
|
@@ -167,13 +162,12 @@ class PreviewComponent extends Component {
|
|
167
162
|
*/
|
168
163
|
afterSetFavorited(value, oldValue) {
|
169
164
|
let me = this,
|
170
|
-
|
171
|
-
button = vdom.cn[0].cn[2];
|
165
|
+
button = me.vdom.cn[0].cn[2];
|
172
166
|
|
173
167
|
NeoArray.add(button.cls, value ? 'btn-primary' : 'btn-outline-primary');
|
174
168
|
NeoArray.remove(button.cls, value ? 'btn-outline-primary' : 'btn-primary');
|
175
169
|
|
176
|
-
me.
|
170
|
+
me.update();
|
177
171
|
|
178
172
|
// ignore the initial setter call
|
179
173
|
if (Neo.isBoolean(oldValue)) {
|
@@ -188,10 +182,8 @@ class PreviewComponent extends Component {
|
|
188
182
|
* @protected
|
189
183
|
*/
|
190
184
|
afterSetFavoritesCount(value, oldValue) {
|
191
|
-
|
192
|
-
|
193
|
-
VDomUtil.getByFlag(vdom, 'favoritesCount').html = ' ' + value;
|
194
|
-
this.vdom = vdom;
|
185
|
+
VDomUtil.getByFlag(this.vdom, 'favoritesCount').html = ' ' + value;
|
186
|
+
this.update();
|
195
187
|
}
|
196
188
|
|
197
189
|
/**
|
@@ -201,11 +193,9 @@ class PreviewComponent extends Component {
|
|
201
193
|
* @protected
|
202
194
|
*/
|
203
195
|
afterSetSlug(value, oldValue) {
|
204
|
-
let vdom = this.vdom;
|
205
|
-
|
206
196
|
// todo: re-add once the new details view is in place
|
207
|
-
//VDomUtil.getByFlag(vdom, 'preview-link').href = '#/article/' + value;
|
208
|
-
this.
|
197
|
+
// VDomUtil.getByFlag(this.vdom, 'preview-link').href = '#/article/' + value;
|
198
|
+
// this.update();
|
209
199
|
}
|
210
200
|
|
211
201
|
/**
|
@@ -241,7 +231,7 @@ class PreviewComponent extends Component {
|
|
241
231
|
|
242
232
|
vdom.cn[1].cn.push(tagList);
|
243
233
|
|
244
|
-
me.
|
234
|
+
me.update();
|
245
235
|
}
|
246
236
|
}
|
247
237
|
|
@@ -252,10 +242,8 @@ class PreviewComponent extends Component {
|
|
252
242
|
* @protected
|
253
243
|
*/
|
254
244
|
afterSetTitle(value, oldValue) {
|
255
|
-
|
256
|
-
|
257
|
-
VDomUtil.getByFlag(vdom, 'title').html = value;
|
258
|
-
this.vdom = vdom;
|
245
|
+
VDomUtil.getByFlag(this.vdom, 'title').html = value;
|
246
|
+
this.update();
|
259
247
|
}
|
260
248
|
|
261
249
|
/**
|
@@ -265,10 +253,8 @@ class PreviewComponent extends Component {
|
|
265
253
|
* @protected
|
266
254
|
*/
|
267
255
|
afterSetUserImage(value, oldValue) {
|
268
|
-
|
269
|
-
|
270
|
-
VDomUtil.getByFlag(vdom, 'userImageLink').cn[0].src = value;
|
271
|
-
this.vdom = vdom;
|
256
|
+
VDomUtil.getByFlag(this.vdom, 'userImageLink').cn[0].src = value;
|
257
|
+
this.update();
|
272
258
|
}
|
273
259
|
|
274
260
|
/**
|
@@ -27,11 +27,10 @@ class PreviewList extends List {
|
|
27
27
|
* @param {Boolean} [silent=false]
|
28
28
|
*/
|
29
29
|
createItems(silent=false) {
|
30
|
-
let me
|
31
|
-
vdom = me.vdom,
|
30
|
+
let me = this,
|
32
31
|
listItem;
|
33
32
|
|
34
|
-
vdom.cn = [];
|
33
|
+
me.vdom.cn = [];
|
35
34
|
|
36
35
|
me.store.items.forEach(item => {
|
37
36
|
listItem = Neo.create({
|
@@ -42,12 +41,10 @@ class PreviewList extends List {
|
|
42
41
|
userImage: item.author.image
|
43
42
|
});
|
44
43
|
|
45
|
-
vdom.cn.push(listItem.vdom);
|
44
|
+
me.vdom.cn.push(listItem.vdom);
|
46
45
|
});
|
47
46
|
|
48
|
-
if (silent) {
|
49
|
-
me._vdom = vdom;
|
50
|
-
} else {
|
47
|
+
if (!silent) {
|
51
48
|
me.promiseVdomUpdate().then(() => {
|
52
49
|
me.fire('createItems');
|
53
50
|
});
|
@@ -92,14 +92,13 @@ class TagListComponent extends Component {
|
|
92
92
|
* @protected
|
93
93
|
*/
|
94
94
|
afterSetTags(value, oldValue) {
|
95
|
-
let me
|
96
|
-
vdom = me.vdom;
|
95
|
+
let me = this;
|
97
96
|
|
98
|
-
vdom.cn[0].cn[1].cn = [];
|
97
|
+
me.vdom.cn[0].cn[1].cn = [];
|
99
98
|
|
100
99
|
if (Array.isArray(value)) {
|
101
100
|
value.forEach(item => {
|
102
|
-
vdom.cn[0].cn[1].cn.push({
|
101
|
+
me.vdom.cn[0].cn[1].cn.push({
|
103
102
|
tag : 'a',
|
104
103
|
cls : ['tag-pill', 'tag-default'],
|
105
104
|
href: '',
|
@@ -108,7 +107,7 @@ class TagListComponent extends Component {
|
|
108
107
|
});
|
109
108
|
});
|
110
109
|
|
111
|
-
me.
|
110
|
+
me.update();
|
112
111
|
}
|
113
112
|
}
|
114
113
|
|