Scroll component #643
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-09-05 13:06:40 +02:00
parent 59c6952025
commit 176750046a
17 changed files with 73 additions and 14 deletions

View File

@ -45,4 +45,4 @@ import './input-file';
import './treeview';
import './treeview/child';
import './calendar';
import './scroll-up/scroll-up';

View File

@ -0,0 +1,5 @@
<button class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-js-ripple-effect mdl-button--colored"
ng-click="$ctrl.goUp()"
vn-tooltip="Go up">
<vn-icon icon="keyboard_arrow_up"></vn-icon>
</button>

View File

@ -0,0 +1,35 @@
import ngModule from '../../module';
import Component from '../../lib/component';
import './style.scss';
export default class Controller extends Component {
constructor($element, $scope, $window) {
super($element, $scope);
this.$window = $window;
$window.addEventListener('scroll', () => {
console.log($element[0]);
if ($window.scrollY > 0)
$element[0].style.display = 'block';
else
$element[0].style.display = 'none';
});
}
goUp() {
this.$window.scrollTo(0, 0);
}
}
Controller.$inject = ['$element', '$scope', '$window'];
ngModule.component('vnScrollUp', {
template: require('./scroll-up.html'),
controller: Controller,
bindings: {
field: '=?',
options: '<?',
disabled: '<?',
checked: '<?'
}
});

View File

@ -0,0 +1,6 @@
vn-scroll-up {
top: 5em;
right: 1.8em;
display: none;
position: fixed;
}

View File

@ -50,4 +50,5 @@ Fields to show: Campos a mostrar
Create new one: Crear nuevo
Toggle: Desplegar/Plegar
Check all: Seleccionar todo
Select a file: Selecciona un fichero
Select a file: Selecciona un fichero
Go up: Ir arriba

View File

@ -51,8 +51,8 @@ a, .link {
}
html [fixed-bottom-right] {
position: fixed;
bottom: 2em;
right: 2em;
bottom: 1.3em;
right: 1.3em;
}
html [text-center], .text-center {
text-align: center;

View File

@ -81,4 +81,5 @@
vn-acl="deliveryBoss"
vn-acl-action="remove">
</vn-float-button>
</a>
</a>
<vn-scroll-up></vn-scroll-up>

View File

@ -75,4 +75,5 @@
<tpl-body>
<vn-claim-summary claim="$ctrl.claimSelected"></vn-claim-summary>
</tpl-body>
</vn-dialog>
</vn-dialog>
<vn-scroll-up></vn-scroll-up>

View File

@ -66,4 +66,5 @@
<tpl-body>
<vn-client-summary client="$ctrl.clientSelected"></vn-client-summary>
</tpl-body>
</vn-dialog>
</vn-dialog>
<vn-scroll-up></vn-scroll-up>

View File

@ -78,3 +78,4 @@
</tpl-body>
</vn-dialog>
<vn-client-descriptor-popover vn-id="clientDescriptor"></vn-client-descriptor-popover>
<vn-scroll-up></vn-scroll-up>

View File

@ -81,4 +81,6 @@
</vn-ticket-descriptor-popover>
<vn-client-descriptor-popover
vn-id="clientDescriptor">
</vn-client-descriptor-popover>
</vn-client-descriptor-popover>
<vn-scroll-up></vn-scroll-up>

View File

@ -145,4 +145,5 @@
<vn-worker-descriptor-popover
vn-id="workerDescriptor"
worker-fk="$ctrl.selectedWorker">
</vn-worker-descriptor-popover>
</vn-worker-descriptor-popover>
<vn-scroll-up></vn-scroll-up>

View File

@ -90,4 +90,5 @@
<tpl-body>
<vn-order-summary order="$ctrl.selectedOrder"></vn-order-summary>
</tpl-body>
</vn-dialog>
</vn-dialog>
<vn-scroll-up></vn-scroll-up>

View File

@ -74,4 +74,5 @@
</vn-worker-descriptor-popover>
<a ui-sref="route.create" vn-tooltip="New route" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>
</a>
</a>
<vn-scroll-up></vn-scroll-up>

View File

@ -160,4 +160,5 @@
</vn-worker-descriptor-popover>
<vn-client-balance-create
vn-id="balanceCreateDialog">
</vn-client-balance-create>
</vn-client-balance-create>
<vn-scroll-up></vn-scroll-up>

View File

@ -51,4 +51,5 @@
</vn-table>
</vn-card>
<vn-pagination model="model"></vn-pagination>
</div>
</div>
<vn-scroll-up></vn-scroll-up>

View File

@ -72,4 +72,5 @@
<tpl-body>
<vn-worker-summary worker="$ctrl.selectedWorker"></vn-worker-summary>
</tpl-body>
</vn-dialog>
</vn-dialog>
<vn-scroll-up></vn-scroll-up>