From 23fe7dca62792cb7c6d9f25cdcbd6453b4bec971 Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Thu, 17 Mar 2016 14:37:13 +0800 Subject: [PATCH] Auto-focus fields in forms on the popup menu. Fix #722. --- omega-web/src/popup.jade | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/omega-web/src/popup.jade b/omega-web/src/popup.jade index c85f999..25a0861 100644 --- a/omega-web/src/popup.jade +++ b/omega-web/src/popup.jade @@ -36,7 +36,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp) = ' ' span(ng-show='!nameExternal.open') {{'popup_externalProfile' | tr}} input.form-control(ng-show='!!nameExternal.open' ng-model='externalProfile.name' ng-blur='nameExternalForm.submit()' - placeholder='{{"popup_externalProfileName" | tr}}' ui-validate='validateProfileName') + placeholder='{{"popup_externalProfileName" | tr}}' ui-validate='validateProfileName' autofocus) li.request-info(ng-show='!!requestInfoProvided' class='bg-warning') a(href='#' role='button' ng-click='showRequestInfo = true' data-shortcut='requestInfo') span.glyphicon.glyphicon-warning-sign.text-warning @@ -105,7 +105,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp) option(value='KeywordCondition') {{'condition_KeywordCondition' | tr}} div.form-group label {{'options_conditionDetails' | tr}} - input.form-control.condition-details(type='text' required ng-model='rule.condition.pattern') + input.form-control.condition-details(type='text' required ng-model='rule.condition.pattern' autofocus) div.form-group label {{'options_resultProfile' | tr}} div(omega-profile-select='validResultProfiles' ng-model='rule.profileName' @@ -135,9 +135,10 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp) .text-warning {{'popup_requestErrorWarning' | tr}} p.help-block {{'popup_requestErrorWarningHelp' | tr}} p.help-block(ng-show='!!currentProfileCanAddRule') {{'popup_requestErrorAddCondition' | tr}} - .checkbox(ng-repeat='domain in requestInfo.domains') + .checkbox(ng-repeat='domain in requestInfo.domains track by domain.domain') label - input(type='checkbox' ng-model='domainsForCondition[domain.domain]') + input(type='checkbox' ng-model='domainsForCondition[domain.domain]' autofocus ng-if='$index === 0') + input(type='checkbox' ng-model='domainsForCondition[domain.domain]' ng-if='$index > 0') span.label.label-warning {{domain.errorCount}} =' {{domain.domain}}' div.form-group(ng-show='!!currentProfileCanAddRule')