diff --git a/src/Squidex/app-config/webpack.run.dev.js b/src/Squidex/app-config/webpack.run.dev.js index 130d5a672..629e7d820 100644 --- a/src/Squidex/app-config/webpack.run.dev.js +++ b/src/Squidex/app-config/webpack.run.dev.js @@ -57,6 +57,9 @@ module.exports = webpackMerge(runConfig, { ], devServer: { - historyApiFallback: true, stats: 'minimal' + historyApiFallback: true, stats: 'minimal', + headers: { + 'Access-Control-Allow-Origin': '*' + } } }); \ No newline at end of file diff --git a/src/Squidex/app/features/schemas/pages/schema/field.component.html b/src/Squidex/app/features/schemas/pages/schema/field.component.html index 13cf0a94b..e22bd3e5b 100644 --- a/src/Squidex/app/features/schemas/pages/schema/field.component.html +++ b/src/Squidex/app/features/schemas/pages/schema/field.component.html @@ -1,7 +1,5 @@
-
- - +
diff --git a/src/Squidex/app/features/schemas/pages/schema/field.component.scss b/src/Squidex/app/features/schemas/pages/schema/field.component.scss index b5ec4b247..6b9f038a4 100644 --- a/src/Squidex/app/features/schemas/pages/schema/field.component.scss +++ b/src/Squidex/app/features/schemas/pages/schema/field.component.scss @@ -9,21 +9,11 @@ $field-header: #e7ebef; .field { &-summary { - padding: 1rem 1.25rem 1rem 1.5rem; + padding: 1rem 1.25rem; position: relative; line-height: 2.5rem; } - &-drag { - @include absolute(0, auto, 0, 0); - z-index: 1000; - font-size: 1.4rem; - font-weight: normal; - line-height: 4.8rem; - cursor: move; - color: $color-border; - } - &-icon { margin-right: 1rem; color: $color-border-dark; diff --git a/src/Squidex/app/features/schemas/utils/sorted.directive.ts b/src/Squidex/app/features/schemas/utils/sorted.directive.ts index 3ccf1c3e5..66c02e0c3 100644 --- a/src/Squidex/app/features/schemas/utils/sorted.directive.ts +++ b/src/Squidex/app/features/schemas/utils/sorted.directive.ts @@ -18,6 +18,8 @@ import { selector: '[sorted]' }) export class SortedDirective { + private oldArray: any[]; + @Output() public sorted = new EventEmitter>(); @@ -26,13 +28,31 @@ export class SortedDirective { sortableContainer: SortableContainer, sortableDragDropService: DragDropSortableService ) { - const oldCallback = sortableComponent._onDropCallback.bind(sortableComponent); + const oldDragStartCallback = sortableComponent._onDragStartCallback.bind(sortableComponent); + + sortableComponent._onDragStartCallback = (event: Event) => { + oldDragStartCallback(); + + this.oldArray = [...sortableContainer.sortableData]; + }; + + const oldDropCallback = sortableComponent._onDropCallback.bind(sortableComponent); sortableComponent._onDropCallback = (event: Event) => { - oldCallback(event); + oldDropCallback(event); if (sortableDragDropService.isDragged) { - this.sorted.emit(sortableContainer.sortableData); + const newArray = sortableContainer.sortableData; + const oldArray = this.oldArray; + + if (newArray && oldArray && newArray.length === oldArray.length) { + for (let i = 0; i < oldArray.length; i++) { + if (oldArray[i] !== newArray[i]) { + this.sorted.emit(newArray); + break; + } + } + } } }; } diff --git a/src/Squidex/app/shared/components/history.component.html b/src/Squidex/app/shared/components/history.component.html index 5c1803c74..3765d5feb 100644 --- a/src/Squidex/app/shared/components/history.component.html +++ b/src/Squidex/app/shared/components/history.component.html @@ -13,11 +13,11 @@
- +
- {{actorName(event.actor) | async}} + {{event.actor | userNameRef:'I'}}
{{event.created | fromNow}}