From 8869a2c79c6101e2b16aeff6abfe58d97d7abc28 Mon Sep 17 00:00:00 2001 From: Paul Kling Date: Tue, 13 Dec 2016 14:25:23 -0600 Subject: [PATCH] feat(templates): automatically scroll up to the app template form after selecting a template --- app/components/templates/templates.html | 3 +-- app/components/templates/templatesController.js | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/templates/templates.html b/app/components/templates/templates.html index 49ef933c1..66ed097a6 100644 --- a/app/components/templates/templates.html +++ b/app/components/templates/templates.html @@ -6,8 +6,7 @@ Templates - -
+
diff --git a/app/components/templates/templatesController.js b/app/components/templates/templatesController.js index 1d442a9a3..e271e6b3f 100644 --- a/app/components/templates/templatesController.js +++ b/app/components/templates/templatesController.js @@ -1,6 +1,6 @@ angular.module('templates', []) -.controller('TemplatesController', ['$scope', '$q', '$state', '$filter', 'Config', 'Info', 'Container', 'ContainerHelper', 'Image', 'Volume', 'Network', 'Templates', 'TemplateHelper', 'Messages', 'Settings', -function ($scope, $q, $state, $filter, Config, Info, Container, ContainerHelper, Image, Volume, Network, Templates, TemplateHelper, Messages, Settings) { +.controller('TemplatesController', ['$scope', '$q', '$state', '$filter', '$anchorScroll', 'Config', 'Info', 'Container', 'ContainerHelper', 'Image', 'Volume', 'Network', 'Templates', 'TemplateHelper', 'Messages', 'Settings', +function ($scope, $q, $state, $filter, $anchorScroll, Config, Info, Container, ContainerHelper, Image, Volume, Network, Templates, TemplateHelper, Messages, Settings) { $scope.state = { selectedTemplate: null, showAdvancedOptions: false @@ -179,6 +179,7 @@ function ($scope, $q, $state, $filter, Config, Info, Container, ContainerHelper, var selectedTemplate = $scope.templates[id]; $scope.state.selectedTemplate = selectedTemplate; $scope.formValues.ports = selectedTemplate.ports ? TemplateHelper.getPortBindings(selectedTemplate.ports) : []; + $anchorScroll('selectedTemplate'); } };