int events again each time page changes
This commit is contained in:
parent
2f7b6790db
commit
3b6e9d7b0b
|
@ -47,6 +47,10 @@ angular
|
|||
|
||||
$scope.typeChanged = function () {
|
||||
$scope.cipher.type = parseInt($scope.selectedType);
|
||||
|
||||
$timeout(function () {
|
||||
utilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
$scope.savePromise = null;
|
||||
|
@ -95,6 +99,10 @@ angular
|
|||
name: null,
|
||||
value: null
|
||||
});
|
||||
|
||||
$timeout(function () {
|
||||
utilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
$scope.removeField = function (field) {
|
||||
|
|
|
@ -38,6 +38,10 @@ angular
|
|||
|
||||
$scope.typeChanged = function () {
|
||||
$scope.cipher.type = parseInt($scope.selectedType);
|
||||
|
||||
$timeout(function () {
|
||||
utilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
$scope.savePromise = null;
|
||||
|
@ -111,6 +115,10 @@ angular
|
|||
name: null,
|
||||
value: null
|
||||
});
|
||||
|
||||
$timeout(function () {
|
||||
utilsService.initListSectionItemListeners(document, angular);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
$scope.removeField = function (field) {
|
||||
|
|
|
@ -299,8 +299,16 @@ export default class UtilsService implements UtilsServiceInterface {
|
|||
throw new Error('doc parameter required');
|
||||
}
|
||||
|
||||
const sectionItems = doc.querySelectorAll('.list-section-item');
|
||||
const sectionItems = doc.querySelectorAll(
|
||||
'.list-section-item:not([data-bw-events="1"])');
|
||||
const sectionFormItems = doc.querySelectorAll(
|
||||
'.list-section-item:not([data-bw-events="1"]) input, ' +
|
||||
'.list-section-item:not([data-bw-events="1"]) select, ' +
|
||||
'.list-section-item:not([data-bw-events="1"]) textarea');
|
||||
|
||||
sectionItems.forEach((item) => {
|
||||
(item as HTMLElement).dataset.bwEvents = '1';
|
||||
|
||||
item.addEventListener('click', (e) => {
|
||||
if (e.defaultPrevented) {
|
||||
return;
|
||||
|
@ -342,9 +350,10 @@ export default class UtilsService implements UtilsServiceInterface {
|
|||
}, false);
|
||||
});
|
||||
|
||||
const sectionFormItems = doc.querySelectorAll(
|
||||
'.list-section-item input, .list-section-item select, .list-section-item textarea');
|
||||
sectionFormItems.forEach((item) => {
|
||||
const itemCell = item.closest('.list-section-item');
|
||||
(itemCell as HTMLElement).dataset.bwEvents = '1';
|
||||
|
||||
item.addEventListener('focus', (e: Event) => {
|
||||
const el = e.target as HTMLElement;
|
||||
const cell = el.closest('.list-section-item');
|
||||
|
|
Loading…
Reference in New Issue