mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
refresh route after smart section edit
This commit is contained in:
parent
f0590139b1
commit
72e715919e
7 changed files with 25 additions and 33 deletions
|
@ -30,11 +30,11 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
toEdit: '',
|
||||
|
||||
didReceiveAttrs() {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('sectionService').getSpaceBlocks(this.get('folder.id')).then((blocks) => {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('blocks', blocks);
|
||||
this.set('hasBlocks', blocks.get('length') > 0);
|
||||
|
||||
|
@ -141,8 +141,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
promise.then((id) => {
|
||||
if (model.page.pageType === 'section') {
|
||||
this.set('toEdit', id);
|
||||
} else {
|
||||
this.get('onEditSection')(id);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -110,11 +110,16 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
|||
|
||||
this.get('sectionService').fetch(page, "items", this.get('config'))
|
||||
.then(function (response) {
|
||||
// console.log(response);
|
||||
if (self.get('isDestroyed') || self.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
self.set('items', response);
|
||||
self.set('config.itemCount', response.length);
|
||||
self.set('waiting', false);
|
||||
}, function (reason) { //jshint ignore: line
|
||||
if (self.get('isDestroyed') || self.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
self.set('items', []);
|
||||
self.set('waiting', false);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue