Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: TTA-189 dropped unused function
  • Loading branch information
mmaquina committed Nov 18, 2022
commit ad2c9d56b8b57a71dd467b25f52848c2cb98a243
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('CustomerTableListComponent', () => {
spyOn(store, 'dispatch');

component.editCustomer('1');
const bottomElement = document.getElementById("bottom");
const bottomElement = document.getElementById('bottom');
expect(bottomElement).toBeTrue();

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,13 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {

scrollToCustomerForm(): void {
/* Makes the editCustomer form visible */
const element = document.getElementById("bottom");
const element = document.getElementById('bottom');
element.scrollIntoView();
}


isVisible( elm ) {
/* Check if an element is visible on the screen */
const vpH = $(window).height(); // Viewport Height
const st = $(window).scrollTop(); // Scroll Top
const y = $(elm).offset().top;
const elementHeight = $(elm).height();
console.log(vpH, st, y, elementHeight);

return ((y < (vpH + st)) && (y > (st - elementHeight)));
}

waitForForm() {
const selector = "customerFormDiv";
const selector = 'customerFormDiv';
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,4 @@ describe('CustomerComponent', () => {
expect(component.hasChangeComponent).toBe(true);
});



function isVisible( elm ) {
/* Check if an element is visible on the screen */
const vpH = $(window).height(); // Viewport Height
const st = $(window).scrollTop(); // Scroll Top
const y = $(elm).offset().top;
const elementHeight = $(elm).height();

return ((y < (vpH + st)) && (y > (st - elementHeight)));
}
});
13 changes: 0 additions & 13 deletions src/app/modules/customer-management/pages/customer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,8 @@ export class CustomerComponent {
this.hasChangeComponent = event;
}


scrollToCustomerForm(): void {
const element = document.getElementById("bottom");
element.scrollIntoView();
this.isVisible(element);
}


isVisible( elm ) {
/* Check if an element is visible on the screen */
const vpH = $(window).height(); // Viewport Height
const st = $(window).scrollTop(); // Scroll Top
const y = $(elm).offset().top;
const elementHeight = $(elm).height();

return ((y < (vpH + st)) && (y > (st - elementHeight)));
}
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const webpack = require('webpack')
const { addTailwindPlugin } = require("@ngneat/tailwind");
const tailwindConfig = require("./tailwind.config.js");
require('dotenv').config({ path: './.dev.env' });
require('dotenv').config();

module.exports = (config) => {
const config_ = {
Expand Down