Skip to content

Commit

Permalink
Refactor CustomModal to Modal with improved architecture
Browse files Browse the repository at this point in the history
Renamed and migrated `CustomModal` to `Modal` to streamline the modal implementation. The new `Modal` class leverages `IFlow` for dynamic content updates and relies on `ModalSettings` for configuration, improving modularity and maintainability. Updated related interfaces, exceptions, and test files accordingly. Enhanced `DraggableElement` to include a visual handle cue. Improved readability and separation of concerns by organizing the modal's settings into a dedicated class.
  • Loading branch information
PxaMMaxP committed Aug 18, 2024
1 parent 485f7e8 commit 8037865
Show file tree
Hide file tree
Showing 8 changed files with 494 additions and 384 deletions.
328 changes: 0 additions & 328 deletions src/libs/Modals/CustomModal/CustomModal.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/libs/Modals/CustomModal/DraggableElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class DraggableElement extends DIComponent implements IDraggableElement {
*/
public enableDragging(): void {
if (this._dragHandle != null) {
this._dragHandle.classList.add('draggable-handle');
this._dragHandle.style.cursor = 'grab';

this.registerDomEvent(
Expand Down Expand Up @@ -131,7 +132,7 @@ export class DraggableElement extends DIComponent implements IDraggableElement {
this._isDragging = true;
this._initialX = event.clientX - this._currentX;
this._initialY = event.clientY - this._currentY;
this._dragHandle.style.cursor = 'grabbing'; // Change cursor to grabbing
this._dragHandle.style.cursor = 'grabbing';
}
}

Expand Down
Loading

0 comments on commit 8037865

Please sign in to comment.