mirror of
https://github.com/documize/community.git
synced 2025-07-23 23:29:42 +02:00
doc entry fixes
This commit is contained in:
parent
e7c4b2f40b
commit
f8de397f33
10 changed files with 17 additions and 34 deletions
|
@ -69,7 +69,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
let state = tocUtil.getState(toc, page);
|
||||
|
||||
if (!this.get('isEditor') || is.empty(pageId)) {
|
||||
state.actionablePage = state.upDisabled = state.downDisabled = state.indentDisabled = state.outdentDisabled = false;
|
||||
state.actionablePage = false;
|
||||
state.upDisabled = state.downDisabled = state.indentDisabled = state.outdentDisabled = true;
|
||||
}
|
||||
|
||||
this.set('state', state);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -25,23 +25,23 @@ export default Ember.Component.extend({
|
|||
},
|
||||
|
||||
didInsertElement() {
|
||||
let self = this;
|
||||
|
||||
$('#table-editor').froalaEditor({
|
||||
toolbarButtons: [],
|
||||
height: this.get('editorHeight') - 260,
|
||||
height: $(document).height() - 400,
|
||||
toolbarInline: true,
|
||||
tableResizerOffset: 10
|
||||
});
|
||||
|
||||
$('#table-editor').on('froalaEditor.contentChanged', function () {
|
||||
self.set('isDirty', true);
|
||||
$('#table-editor').on('froalaEditor.contentChanged', () => {
|
||||
this.set('isDirty', true);
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
$('#table-editor').froalaEditor('destroy');
|
||||
$('#table-editor').off('froalaEditor.contentChanged');
|
||||
// if ($('#table-editor').data('froala.editor')) {
|
||||
// $('#table-editor').froalaEditor('destroy');
|
||||
// }
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
@ -69,4 +69,4 @@ export default Ember.Component.extend({
|
|||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -25,7 +25,7 @@ export default Ember.Component.extend({
|
|||
},
|
||||
|
||||
didInsertElement() {
|
||||
let maxHeight = $(document).height() - $(".document-editor > .toolbar").height() - 200;
|
||||
let maxHeight = $(document).height() - 450;
|
||||
|
||||
let options = {
|
||||
selector: "#rich-text-editor",
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
|
||||
export default Ember.Controller.extend(NotifierMixin, {
|
||||
export default Ember.Controller.extend({
|
||||
documentService: Ember.inject.service('document'),
|
||||
|
||||
actions: {
|
||||
|
@ -26,8 +25,6 @@ export default Ember.Controller.extend(NotifierMixin, {
|
|||
|
||||
onAction(page, meta) {
|
||||
let self = this;
|
||||
this.showNotification("Saving");
|
||||
|
||||
let model = {
|
||||
page: page.toJSON({ includeId: true }),
|
||||
meta: meta.toJSON({ includeId: true })
|
||||
|
|
|
@ -10,15 +10,13 @@
|
|||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
|
||||
export default Ember.Controller.extend(NotifierMixin, {
|
||||
export default Ember.Controller.extend({
|
||||
documentService: Ember.inject.service('document'),
|
||||
|
||||
actions: {
|
||||
onSave(doc) {
|
||||
this.get('documentService').save(doc).then(() => {
|
||||
this.showNotification('Saved');
|
||||
this.transitionToRoute('document.index');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
folderService: Ember.inject.service('folder'),
|
||||
sectionService: Ember.inject.service('section'),
|
||||
|
||||
model(params) {
|
||||
model() {
|
||||
return Ember.RSVP.hash({
|
||||
folders: this.modelFor('document').folders,
|
||||
folder: this.modelFor('document').folder,
|
||||
|
|
|
@ -145,7 +145,6 @@ export default Ember.Route.extend(NotifierMixin, {
|
|||
var payload = { Message: message, Roles: data };
|
||||
|
||||
this.get('folderService').savePermissions(folder.get('id'), payload).then(() => {
|
||||
this.showNotification("Saved");
|
||||
});
|
||||
|
||||
var hasEveryone = _.find(data, function (permission) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{{#section/base-editor document=document folder=folder page=page tip="Concise name that describes the table" isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
||||
{{focus-textarea value=pageBody id="table-editor" class="mousetrap"}}
|
||||
{{textarea value=pageBody id="table-editor" class="mousetrap"}}
|
||||
{{/section/base-editor}}
|
||||
|
|
|
@ -72,18 +72,6 @@ function getState(toc, page) {
|
|||
if (state.tocTools.indentIncrement === 0) {
|
||||
state.tocTools.indentIncrement = 1;
|
||||
}
|
||||
|
||||
// for (var i2 = index2; i2 >= 0; i2--) {
|
||||
// if (page.level < toc[i2].level) {
|
||||
// state.tocTools.allowIndent = false;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// if (page.level === toc[i2].level) {
|
||||
// state.tocTools.allowIndent = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ func (p *Persister) AddPage(model models.PageModel) (err error) {
|
|||
err = row.Scan(&maxSeq)
|
||||
|
||||
if err != nil {
|
||||
log.Error("unable to select max page.sequence", err)
|
||||
maxSeq = 2048
|
||||
}
|
||||
|
||||
model.Page.Sequence = maxSeq * 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue