mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
fixes
This commit is contained in:
parent
0d9400965d
commit
9f7585e2a5
18 changed files with 126 additions and 103 deletions
|
@ -37,13 +37,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
didRender() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.contentLinkHandler();
|
||||
|
||||
let self = this;
|
||||
$(".tooltipped").each(function(i, el) {
|
||||
self.addTooltip(el);
|
||||
});
|
||||
let jumpTo = this.get('pageId');
|
||||
if (is.not.empty(jumpTo) && is.not.undefined(jumpTo) && !$("#page-" + jumpTo).inView()) {
|
||||
$("#page-" + jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
||||
}
|
||||
|
||||
this.contentLinkHandler();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -57,15 +57,10 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
} });
|
||||
|
||||
let jumpTo = this.get('pageId');
|
||||
if (is.not.empty(jumpTo)) {
|
||||
let self = this;
|
||||
$("#page-" + jumpTo).velocity("scroll", { duration: 250, offset: -100, complete:
|
||||
function() {
|
||||
self.set('pageId', '');
|
||||
}
|
||||
});
|
||||
}
|
||||
let self = this;
|
||||
$(".tooltipped").each(function(i, el) {
|
||||
self.addTooltip(el);
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
|
|
|
@ -18,7 +18,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
document: {},
|
||||
folder: {},
|
||||
pages: [],
|
||||
page: "",
|
||||
currentPageId: "",
|
||||
state: {
|
||||
actionablePage: false,
|
||||
upDisabled: true,
|
||||
|
@ -35,8 +35,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 0);
|
||||
|
||||
if (is.not.null(this.get('page'))) {
|
||||
this.send('onEntryClick', this.get('page'));
|
||||
if (is.not.null(this.get('currentPageId'))) {
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -71,7 +71,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
// Controls what user can do with the toc (left sidebar).
|
||||
// Identifies the target pages.
|
||||
setState(pageId) {
|
||||
this.set('page', pageId);
|
||||
this.set('currentPageId', pageId);
|
||||
|
||||
let toc = this.get('pages');
|
||||
let page = _.findWhere(toc, { id: pageId });
|
||||
|
@ -94,13 +94,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.findWhere(pages, { id: this.get('page') });
|
||||
let page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.moveUp(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
this.attrs.onPageSequenceChange(pendingChanges);
|
||||
|
||||
this.send('onEntryClick', this.get('page'));
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
this.audit.record("moved-page-up");
|
||||
this.showNotification("Moved up");
|
||||
}
|
||||
|
@ -114,13 +114,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
let state = this.get('state');
|
||||
var pages = this.get('pages');
|
||||
var page = _.findWhere(pages, { id: this.get('page') });
|
||||
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.moveDown(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
this.attrs.onPageSequenceChange(pendingChanges);
|
||||
|
||||
this.send('onEntryClick', this.get('page'));
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
this.audit.record("moved-page-down");
|
||||
this.showNotification("Moved down");
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
let state = this.get('state');
|
||||
var pages = this.get('pages');
|
||||
var page = _.findWhere(pages, { id: this.get('page') });
|
||||
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.indent(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -142,7 +142,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
this.showNotification("Indent");
|
||||
this.audit.record("changed-page-sequence");
|
||||
this.send('onEntryClick', this.get('page'));
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -154,7 +154,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
let state = this.get('state');
|
||||
var pages = this.get('pages');
|
||||
var page = _.findWhere(pages, { id: this.get('page') });
|
||||
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.outdent(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -162,7 +162,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
|
||||
this.showNotification("Outdent");
|
||||
this.audit.record("changed-page-sequence");
|
||||
this.send('onEntryClick', this.get('page'));
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -74,7 +74,6 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
|||
self.set('authenticated', true);
|
||||
self.set('items', response);
|
||||
self.set('config.APIToken', '********'); // reset the api token once it has been sent to the host
|
||||
console.log("auth token OK");
|
||||
|
||||
self.get('sectionService').fetch(page, "options", config)
|
||||
.then(function (response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue