From 0240f98eb0858289a818372e60588b8fe63bc735 Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 28 May 2019 14:08:19 +0100 Subject: [PATCH] Add scroll to top option for document view Closes #175 --- .../components/layout/grid/sidebar-go-top.js | 24 ++++++++++++++++++ gui/app/constants/constants.js | 1 + gui/app/pods/document/index/template.hbs | 2 +- gui/app/styles/core/icon-ui.scss | 4 +++ gui/app/styles/core/layout/layout.scss | 3 +++ gui/app/styles/core/layout/sidebar.scss | 13 ++++++++++ .../components/layout/grid/sidebar-go-top.hbs | 3 +++ gui/public/assets/font/dmzui.eot | Bin 17156 -> 17312 bytes gui/public/assets/font/dmzui.svg | 3 +++ gui/public/assets/font/dmzui.ttf | Bin 17000 -> 17156 bytes gui/public/assets/font/dmzui.woff | Bin 8920 -> 8968 bytes gui/public/assets/font/dmzui.woff2 | Bin 7348 -> 7400 bytes 12 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 gui/app/components/layout/grid/sidebar-go-top.js create mode 100644 gui/app/templates/components/layout/grid/sidebar-go-top.hbs diff --git a/gui/app/components/layout/grid/sidebar-go-top.js b/gui/app/components/layout/grid/sidebar-go-top.js new file mode 100644 index 00000000..7d0e70c0 --- /dev/null +++ b/gui/app/components/layout/grid/sidebar-go-top.js @@ -0,0 +1,24 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import browser from '../../../services/browser'; +import Component from '@ember/component'; + +export default Component.extend({ + tagName: 'div', + classNames: ['goto-top'], + + actions: { + onClick() { + this.get('browser').scrollTo('html'); + } + } +}); diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index c5e2428c..cc5f1a83 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -232,6 +232,7 @@ let constants = EmberObject.extend({ Export2: 'dicon-upload', Filter: 'dicon-sort-tool', Grid: 'dicon-grid-interface', + GoTop: 'dicon-move-layer-up', Handshake: 'dicon-handshake', Index: 'dicon-menu-8', Integrations: 'dicon-geometry', diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index 98b4a04b..6a01bf2e 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -23,8 +23,8 @@