ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843: Implemented auto-focus directive.
Date Fri, 04 Sep 2015 02:45:37 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 7efb9c742 -> 12b6e6c2d


IGNITE-843: Implemented auto-focus directive.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/12b6e6c2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/12b6e6c2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/12b6e6c2

Branch: refs/heads/ignite-843
Commit: 12b6e6c2d428d2e3e7185701eebfad493548215a
Parents: 7efb9c7
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Sep 4 09:46:08 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Sep 4 09:46:08 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/common-module.js            | 12 ++++++++++++
 .../src/main/js/views/templates/copy.jade               |  2 +-
 .../src/main/js/views/templates/notebook-new.jade       |  2 +-
 .../src/main/js/views/templates/paragraph-rate.jade     |  8 ++++----
 4 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/12b6e6c2/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 042e86d..a7ded92 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -1271,6 +1271,18 @@ controlCenterModule.factory('$focus', function ($timeout) {
     };
 });
 
+// Directive to auto-focus element.
+controlCenterModule.directive('autoFocus', function($timeout) {
+    return {
+        restrict: 'AC',
+        link: function(scope, element) {
+            $timeout(function(){
+                element[0].focus();
+            });
+        }
+    };
+});
+
 // Directive to focus next element on ENTER key.
 controlCenterModule.directive('enterFocusNext', function ($focus) {
     return function (scope, elem, attrs) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/12b6e6c2/modules/control-center-web/src/main/js/views/templates/copy.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/copy.jade b/modules/control-center-web/src/main/js/views/templates/copy.jade
index 9ccd3b6..47f476b 100644
--- a/modules/control-center-web/src/main/js/views/templates/copy.jade
+++ b/modules/control-center-web/src/main/js/views/templates/copy.jade
@@ -25,7 +25,7 @@
                     .col-sm-9.login.col-sm-offset-1
                         label.required.labelFormField New name:&nbsp;
                         .col-sm-9
-                            input.form-control(id='copy-new-name' type='text' ng-model='newName'
required)
+                            input.form-control(id='copy-new-name' type='text' ng-model='newName'
required auto-focus)
             .modal-footer
                 button.btn.btn-default(id='copy-btn-cancel' type='button' ng-click='$hide()')
Cancel
                 button.btn.btn-primary(id='copy-btn-confirm' type='button' ng-disabled='ui.inputForm.$invalid'
ng-click='ok(newName)') Confirm

http://git-wip-us.apache.org/repos/asf/ignite/blob/12b6e6c2/modules/control-center-web/src/main/js/views/templates/notebook-new.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/notebook-new.jade b/modules/control-center-web/src/main/js/views/templates/notebook-new.jade
index 368998d..de2e731 100644
--- a/modules/control-center-web/src/main/js/views/templates/notebook-new.jade
+++ b/modules/control-center-web/src/main/js/views/templates/notebook-new.jade
@@ -25,7 +25,7 @@
                     .col-sm-9.login.col-sm-offset-1
                         label.required.labelFormField Name:&nbsp;
                         .col-sm-9
-                            input.form-control(id='create-notebook' type='text' ng-model='name'
required)
+                            input.form-control(id='create-notebook' type='text' ng-model='name'
required auto-focus)
             .modal-footer
                 button.btn.btn-default(id='copy-btn-cancel' type='button' ng-click='$hide()')
Cancel
                 button.btn.btn-primary(id='copy-btn-confirm' type='button' ng-disabled='ui.inputForm.$invalid'
ng-click='createNewNotebook(name)') Create

http://git-wip-us.apache.org/repos/asf/ignite/blob/12b6e6c2/modules/control-center-web/src/main/js/views/templates/paragraph-rate.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/paragraph-rate.jade b/modules/control-center-web/src/main/js/views/templates/paragraph-rate.jade
index 931329f..3f583cb 100644
--- a/modules/control-center-web/src/main/js/views/templates/paragraph-rate.jade
+++ b/modules/control-center-web/src/main/js/views/templates/paragraph-rate.jade
@@ -21,9 +21,9 @@
         form(name='popoverForm')
             .form-group(style='margin: 0; padding: 5px')
                 .col-sm-4(style='padding: 0')
-                    input.form-control(ng-model='paragraph.rate.value' type='number' required)
+                    input.form-control(id='paragraph-rate' ng-model='paragraph.rate.value'
type='number' required auto-focus)
                 .col-sm-8(style='padding-left: 5px; padding-right: 0')
-                    button.form-control(ng-model='paragraph.rate.unit' required placeholder='Time
unit' bs-select bs-options='item.value as item.label for item in timeUnit' tabindex='0')
+                    button.form-control(id='paragraph-unit' ng-model='paragraph.rate.unit'
required placeholder='Time unit' bs-select bs-options='item.value as item.label for item in
timeUnit' tabindex='0')
             .form-actions(style='margin-top: 30px; padding: 5px')
-                button.btn.btn-primary(ng-disabled='popoverForm.$invalid' type='button' ng-click='popover.saved=true;paragraph.rate.ruined=true;
 $hide()') Set
-                button.btn.btn-primary.btn-default(type='button' ng-click='paragraph.rate.ruined=false;
$hide()') Stop
+                button.btn.btn-primary(id='paragraph-rate-btn-set' ng-disabled='popoverForm.$invalid'
type='button' ng-click='popover.saved=true;paragraph.rate.ruined=true;  $hide()') Set
+                button.btn.btn-primary.btn-default(id='paragraph-rate-btn-stop' type='button'
ng-click='paragraph.rate.ruined=false; $hide()') Stop


Mime
View raw message