1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-21 22:29:41 +02:00

add document section UX

This commit is contained in:
Harvey Kandola 2017-12-15 16:14:44 +00:00
parent a728f14d41
commit af7e089764
3 changed files with 152 additions and 195 deletions

View file

@ -13,31 +13,23 @@ import { notEmpty, empty } from '@ember/object/computed';
import { schedule } from '@ember/runloop';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import NotifierMixin from '../../mixins/notifier';
import TooltipMixin from '../../mixins/tooltip';
export default Component.extend(NotifierMixin, TooltipMixin, {
export default Component.extend(TooltipMixin, {
documentService: service('document'),
sectionService: service('section'),
appMeta: service(),
link: service(),
hasPages: notEmpty('pages'),
newSectionName: 'Section',
newSectionName: '',
newSectionNameMissing: empty('newSectionName'),
newSectionLocation: '',
beforePage: '',
beforePage: null,
toEdit: '',
didReceiveAttrs() {
this._super(...arguments);
this.loadBlocks();
// schedule('afterRender', () => {
// let jumpTo = "#page-" + this.get('pageId');
// if (!$(jumpTo).inView()) {
// $(jumpTo).velocity("scroll", { duration: 250, offset: -100 });
// }
// });
},
didRender() {
@ -84,7 +76,6 @@ export default Component.extend(NotifierMixin, TooltipMixin, {
if (link.orphan) {
$(this).addClass('broken-link');
self.showNotification('Broken link!');
e.preventDefault();
e.stopPropagation();
return false;