mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 20:37:39 -02:30
Remove unused functionality from controller
This commit is contained in:
committed by
Jake McDermott
parent
2e07fee39f
commit
a6ee7b6aac
@@ -7,6 +7,10 @@
|
|||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-menuBottom {
|
&-menuBottom {
|
||||||
@@ -18,6 +22,10 @@
|
|||||||
right: 60px;
|
right: 60px;
|
||||||
bottom: 24px;
|
bottom: 24px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @at-blue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-menuIconGroup {
|
&-menuIconGroup {
|
||||||
@@ -39,6 +47,10 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @at-blue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-menuIcon--lg {
|
&-menuIcon--lg {
|
||||||
@@ -47,6 +59,10 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @at-blue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-toggle {
|
&-toggle {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const meta = {
|
|||||||
|
|
||||||
const PAGE_LIMIT = 3;
|
const PAGE_LIMIT = 3;
|
||||||
const SCROLL_BUFFER = 250;
|
const SCROLL_BUFFER = 250;
|
||||||
const SCROLL_LOAD_DELAY = 250;
|
const SCROLL_LOAD_DELAY = 50;
|
||||||
const EVENT_START_TASK = 'playbook_on_task_start';
|
const EVENT_START_TASK = 'playbook_on_task_start';
|
||||||
const EVENT_START_PLAY = 'playbook_on_play_start';
|
const EVENT_START_PLAY = 'playbook_on_play_start';
|
||||||
const EVENT_STATS_PLAY = 'playbook_on_stats';
|
const EVENT_STATS_PLAY = 'playbook_on_stats';
|
||||||
@@ -161,57 +161,18 @@ function prev () {
|
|||||||
page: data.page
|
page: data.page
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const previousHeight = container.scrollHeight;
|
||||||
|
|
||||||
return pop()
|
return pop()
|
||||||
.then(() => prepend(data.results))
|
.then(() => prepend(data.results))
|
||||||
.then(lines => {
|
.then(lines => {
|
||||||
container.scrollTop = (getRowHeight() * lines)
|
const currentHeight = container.scrollHeight;
|
||||||
|
|
||||||
|
container.scrollTop = currentHeight - previousHeight;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRowCount () {
|
|
||||||
return $(ELEMENT_TBODY).children().length;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRowHeight () {
|
|
||||||
return $(ELEMENT_TBODY).children()[0].offsetHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getViewHeight () {
|
|
||||||
return $(ELEMENT_CONTAINER)[0].offsetHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getScrollPosition () {
|
|
||||||
return $(ELEMENT_CONTAINER)[0].scrollTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getScrollHeight () {
|
|
||||||
return $(ELEMENT_CONTAINER)[0].scrollHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRowsAbove () {
|
|
||||||
const top = getScrollPosition();
|
|
||||||
|
|
||||||
if (top === 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.floor(top / getRowHeight());
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRowsBelow () {
|
|
||||||
const bottom = getScrollPosition() + getViewHeight();
|
|
||||||
|
|
||||||
return Math.floor((getScrollHeight() - bottom) / getRowHeight());
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRowsInView () {
|
|
||||||
const rowHeight = getRowHeight();
|
|
||||||
const viewHeight = getViewHeight();
|
|
||||||
|
|
||||||
return Math.floor(viewHeight / rowHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
function append (events) {
|
function append (events) {
|
||||||
console.log('[4] appending next page');
|
console.log('[4] appending next page');
|
||||||
|
|
||||||
@@ -628,7 +589,7 @@ function scrollEnd () {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
const container = $(ELEMENT_CONTAINER)[0];
|
const container = $(ELEMENT_CONTAINER)[0];
|
||||||
|
|
||||||
container.scrollTop = getScrollHeight();
|
container.scrollTop = container.scrollHeight;
|
||||||
meta.scroll.inProgress = false;
|
meta.scroll.inProgress = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -638,22 +599,14 @@ function scrollPageUp () {
|
|||||||
const container = $(ELEMENT_CONTAINER)[0];
|
const container = $(ELEMENT_CONTAINER)[0];
|
||||||
const jump = container.scrollTop - container.offsetHeight;
|
const jump = container.scrollTop - container.offsetHeight;
|
||||||
|
|
||||||
if (jump < 0) {
|
container.scrollTop = jump;
|
||||||
container.scrollTop = 0;
|
|
||||||
} else {
|
|
||||||
container.scrollTop = jump;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollPageDown () {
|
function scrollPageDown () {
|
||||||
const container = $(ELEMENT_CONTAINER)[0];
|
const container = $(ELEMENT_CONTAINER)[0];
|
||||||
const jump = container.scrollTop + container.offsetHeight;
|
const jump = container.scrollTop + container.offsetHeight;
|
||||||
|
|
||||||
if (jump > container.scrollHeight) {
|
container.scrollTop = jump;
|
||||||
container.scrollTop = container.scrollHeight;
|
|
||||||
} else {
|
|
||||||
container.scrollTop = jump;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JobsIndexController.$inject = [
|
JobsIndexController.$inject = [
|
||||||
|
|||||||
@@ -16,15 +16,15 @@
|
|||||||
<div class="pull-right" ng-click="vm.menu.scroll.end()">
|
<div class="pull-right" ng-click="vm.menu.scroll.end()">
|
||||||
<i class="at-Stdout-menuIcon--lg fa fa-angle-double-down"></i>
|
<i class="at-Stdout-menuIcon--lg fa fa-angle-double-down"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="pull-right" ng-click="vm.menu.scroll.home()">
|
||||||
|
<i class="at-Stdout-menuIcon--lg fa fa-angle-double-up"></i>
|
||||||
|
</div>
|
||||||
<div class="pull-right" ng-click="vm.menu.scroll.down()">
|
<div class="pull-right" ng-click="vm.menu.scroll.down()">
|
||||||
<i class="at-Stdout-menuIcon--lg fa fa-angle-down"></i>
|
<i class="at-Stdout-menuIcon--lg fa fa-angle-down"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right" ng-click="vm.menu.scroll.up()">
|
<div class="pull-right" ng-click="vm.menu.scroll.up()">
|
||||||
<i class="at-Stdout-menuIcon--lg fa fa-angle-up"></i>
|
<i class="at-Stdout-menuIcon--lg fa fa-angle-up"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right" ng-click="vm.menu.scroll.home()">
|
|
||||||
<i class="at-Stdout-menuIcon--lg fa fa-angle-double-up"></i>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="at-u-clear"></div>
|
<div class="at-u-clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user