ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-1686 Added scrolling to the newly created query.
Date Fri, 23 Oct 2015 07:46:51 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 b5341c26d -> 9b36c5dd2


IGNITE-1686 Added scrolling to the newly created query.


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

Branch: refs/heads/ignite-843-rc1
Commit: 9b36c5dd213be9e76af760c47981d6cf31eaa69b
Parents: b5341c2
Author: Andrey <anovikov@gridgain.com>
Authored: Fri Oct 23 14:46:44 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Fri Oct 23 14:46:44 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 35 +++++++++++++++-----
 .../src/main/js/public/stylesheets/style.scss   |  6 ++--
 .../src/main/js/views/sql/sql.jade              | 17 +++++-----
 3 files changed, 38 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9b36c5dd/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index d8a7052..3100204 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -114,18 +114,27 @@ consoleModule.controller('sqlController',
         return false;
     };
 
-    Object.defineProperty($scope, 'scrollParagraph', {
-        get: function() {
-            return undefined;
-        },
-        set: function(paragraph) {
-            $location.hash('paragraph-' + paragraph.id);
+    $scope.scrollParagraphs = [];
 
-            $anchorScroll();
+    $scope.rebuildScrollParagraphs = function () {
+        $scope.scrollParagraphs = $scope.notebook.paragraphs.map(function (paragraph) {
+            return {
+                "text": paragraph.name,
+                "click": 'scrollToParagraph(' + paragraph.id + ')'
+            };
+        });
+    };
+
+    $scope.scrollToParagraph = function (paragraphId) {
+        $location.hash('paragraph-' + paragraphId);
+
+        $anchorScroll();
 
+        var paragraph = _.find($scope.notebook.paragraphs, {id: paragraphId});
+
+        if (paragraph)
             paragraph.ace.focus();
-        }
-    });
+    };
 
     var _hideColumn = function (col) {
         return !(col.fieldName === '_KEY') && !(col.fieldName == '_VAL');
@@ -228,6 +237,8 @@ consoleModule.controller('sqlController',
 
                 if (!notebook.paragraphs || notebook.paragraphs.length == 0)
                     $scope.addParagraph();
+                else
+                    $scope.rebuildScrollParagraphs();
 
                 $scope.startTopologyListening(getTopology);
             })
@@ -306,6 +317,8 @@ consoleModule.controller('sqlController',
         if (paragraph.name != newName) {
             paragraph.name = newName;
 
+            $scope.rebuildScrollParagraphs();
+
             _saveNotebook(function () { paragraph.edit = false; });
         }
         else
@@ -342,6 +355,8 @@ consoleModule.controller('sqlController',
 
         $scope.notebook.paragraphs.push(paragraph);
 
+        $scope.rebuildScrollParagraphs();
+
         $location.hash('paragraph-' + paragraph.id);
 
         $anchorScroll();
@@ -386,6 +401,8 @@ consoleModule.controller('sqlController',
 
                     $scope.notebook.paragraphs.splice(paragraph_idx, 1);
 
+                    $scope.rebuildScrollParagraphs();
+
                     _saveNotebook();
             });
     };

http://git-wip-us.apache.org/repos/asf/ignite/blob/9b36c5dd/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 2a47949..2389909 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -499,9 +499,9 @@ button.form-control {
             height: 35px;
         }
 
-        > button.btn.select-toggle::after {
-            float: left;
-            right: 10px !important;
+        a.dropdown-toggle {
+            font-size: $font-size-base;
+            margin-right: 5px;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9b36c5dd/modules/control-center-web/src/main/js/views/sql/sql.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/sql.jade b/modules/control-center-web/src/main/js/views/sql/sql.jade
index d50df53..9821bb0 100644
--- a/modules/control-center-web/src/main/js/views/sql/sql.jade
+++ b/modules/control-center-web/src/main/js/views/sql/sql.jade
@@ -27,8 +27,8 @@ append scripts
 
     script(src='/sql-controller.js')
 
-mixin btn-toolbar(btn, click, tip)
-    i.btn.btn-default.fa(class=btn ng-click=click bs-tooltip='' data-title=tip data-trigger='hover'
data-placement='bottom')
+mixin btn-toolbar(btn, click, tip, focusId)
+    i.btn.btn-default.fa(class=btn ng-click=click bs-tooltip='' data-title=tip on-click-focus=focusId
data-trigger='hover' data-placement='bottom')
 
 mixin btn-toolbar-data(btn, kind, tip)
     i.btn.btn-default.fa(class=btn ng-click='setResult(paragraph, "#{kind}")' ng-class='{active:
resultEq(paragraph, "#{kind}")}' bs-tooltip='' data-title=tip data-trigger='hover' data-placement='bottom')
@@ -51,7 +51,7 @@ block container
                     label.col-sm-12 Notebook not accessible any more. Go back to configuration
or open to another notebook.
                     button.h3.btn.btn-primary(ng-click='goToConfiguration()') Back to configuration
                 div(ng-if='notebook')
-                    .col-sm-12(bs-affix)
+                    .row(bs-affix)
                         .docs-header.notebook-header(style='padding: 10px 0')
                             h1.col-sm-6(ng-hide='notebook.edit')
                                 label(style='max-width: calc(100% - 60px)') {{notebook.name}}
@@ -63,9 +63,10 @@ block container
                                 .input-tip
                                     input.form-control(ng-model='notebook.editName' required
on-enter='renameNotebook(notebook.editName)' on-escape='notebook.edit = false;')
                             h1.pull-right
+                                a.dropdown-toggle(data-toggle='dropdown' bs-dropdown='scrollParagraphs'
data-placement='bottom-right') Scroll to query
+                                    span.caret
                                 .btn-group(style='margin-top: 0px')
                                     +btn-toolbar('fa-plus', 'addParagraph()', 'Add new query')
-                                button.select-toggle.btn.btn-default(ng-model='scrollParagraph'
data-multiple='0' bs-options='item as item.name for item in notebook.paragraphs' bs-select
bs-tooltip data-placeholder='Scroll to query' data-title='Max number of rows to show in query
result as one page')
                     .block-callout-parent
                         table
                             tbody
@@ -96,10 +97,10 @@ block container
                                         a {{paragraph.name}}
 
                                         .btn-group(ng-hide='notebook.paragraphs.length >
1')
-                                            +btn-toolbar('fa-pencil', 'paragraph.edit = true;
paragraph.editName = paragraph.name; $event.stopPropagation();', 'Rename query')
+                                            +btn-toolbar('fa-pencil', 'paragraph.edit = true;
paragraph.editName = paragraph.name; $event.stopPropagation();', 'Rename query', 'paragraph-name-{{paragraph.id}}')
 
                                         .btn-group(ng-show='notebook.paragraphs.length >
1' ng-click='$event.stopPropagation();')
-                                            +btn-toolbar('fa-pencil', 'paragraph.edit = true;
paragraph.editName = paragraph.name;', 'Rename query')
+                                            +btn-toolbar('fa-pencil', 'paragraph.edit = true;
paragraph.editName = paragraph.name;', 'Rename query', 'paragraph-name-{{paragraph.id}}')
                                             +btn-toolbar('fa-remove', 'removeParagraph(paragraph)',
'Remove query')
 
                                         .pull-right.btn-group(ng-model='paragraph.result'
ng-click='$event.stopPropagation()' style='float: right')
@@ -111,8 +112,8 @@ block container
 
                                     div(ng-show='paragraph.edit')
                                         i.tipLabel.fa(ng-class='paragraphExpanded(paragraph)
? "fa-chevron-circle-up" : "fa-chevron-circle-down"')
-                                        input.sql-name-input(ng-model='paragraph.editName'
required ng-click='$event.stopPropagation();' on-enter='renameParagraph(paragraph, paragraph.editName)'
on-escape='paragraph.edit = false')
-                                        i.tipLabel.fa.fa-floppy-o(ng-show='paragraph.editName'
ng-click='renameParagraph(paragraph, paragraph.editName); $event.stopPropagation();' bs-tooltip
data-title='Save paragraph name' data-trigger='hover')
+                                        input.sql-name-input(id='paragraph-name-{{paragraph.id}}'
ng-model='paragraph.editName' required ng-click='$event.stopPropagation();' on-enter='renameParagraph(paragraph,
paragraph.editName)' on-escape='paragraph.edit = false')
+                                        i.tipLabel.fa.fa-floppy-o(ng-show='paragraph.editName'
ng-click='renameParagraph(paragraph, paragraph.editName); $event.stopPropagation();' bs-tooltip
data-title='Save query name' data-trigger='hover')
                                 .panel-collapse(role='tabpanel' bs-collapse-target)
                                     .col-sm-12(ng-show='paragraph.editor')
                                         .col-xs-8.col-sm-9(style='border-right: 1px solid
#eee')


Mime
View raw message