Merge pull request '3734-fix(item_diary): apply async scroll' (#913) from 3734-item_diary_scroll into dev
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
Reviewed-on: #913 Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
commit
7b19a70f96
|
@ -52,10 +52,12 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
scrollToLine(lineFk) {
|
||||
const hashFk = this.lineFk || lineFk;
|
||||
const hash = `vnItemDiary-${hashFk}`;
|
||||
this.$location.hash(hash);
|
||||
this.$anchorScroll();
|
||||
this.$.$applyAsync(() => {
|
||||
const hashFk = this.lineFk || lineFk;
|
||||
const hash = `vnItemDiary-${hashFk}`;
|
||||
this.$location.hash(hash);
|
||||
this.$anchorScroll();
|
||||
});
|
||||
}
|
||||
|
||||
showDescriptor(event, sale) {
|
||||
|
|
|
@ -47,6 +47,8 @@ describe('Item', () => {
|
|||
controller.lineFk = 1;
|
||||
controller.scrollToLine('invalidValue');
|
||||
|
||||
$scope.$apply();
|
||||
|
||||
expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`);
|
||||
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
||||
});
|
||||
|
@ -56,6 +58,8 @@ describe('Item', () => {
|
|||
controller.lineFk = undefined;
|
||||
controller.scrollToLine(1);
|
||||
|
||||
$scope.$apply();
|
||||
|
||||
expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`);
|
||||
expect(controller.$anchorScroll).toHaveBeenCalledWith();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue