From 933927cda189a6a682b16ea28773536a4d363106 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 29 Jun 2015 09:48:32 -0700 Subject: [PATCH 001/266] [Common UI] Reduce digest count Reduce number of digest cycles triggered by mct-resize; only trigger a new digest cycle when size actually changes. #19. --- .../general/src/directives/MCTResize.js | 5 +-- .../general/test/directives/MCTResizeSpec.js | 36 +++++++++++++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/platform/commonUI/general/src/directives/MCTResize.js b/platform/commonUI/general/src/directives/MCTResize.js index 62ae977271..efe534ffd8 100644 --- a/platform/commonUI/general/src/directives/MCTResize.js +++ b/platform/commonUI/general/src/directives/MCTResize.js @@ -73,6 +73,7 @@ define( lastBounds.width !== bounds.width || lastBounds.height !== bounds.height) { scope.$eval(attrs.mctResize, { bounds: bounds }); + scope.$apply(); // Trigger a digest lastBounds = bounds; } } @@ -85,7 +86,7 @@ define( height: element[0].offsetHeight }); if (active) { - $timeout(onInterval, currentInterval()); + $timeout(onInterval, currentInterval(), false); } } @@ -111,4 +112,4 @@ define( return MCTResize; } -); \ No newline at end of file +); diff --git a/platform/commonUI/general/test/directives/MCTResizeSpec.js b/platform/commonUI/general/test/directives/MCTResizeSpec.js index b0ff7b748a..e5374305c2 100644 --- a/platform/commonUI/general/test/directives/MCTResizeSpec.js +++ b/platform/commonUI/general/test/directives/MCTResizeSpec.js @@ -35,7 +35,7 @@ define( beforeEach(function () { mockTimeout = jasmine.createSpy("$timeout"); - mockScope = jasmine.createSpyObj("$scope", ["$eval", "$on"]); + mockScope = jasmine.createSpyObj("$scope", ["$eval", "$on", "$apply"]); testElement = { offsetWidth: 100, offsetHeight: 200 }; testAttrs = { mctResize: "some-expr" }; @@ -52,7 +52,8 @@ define( mctResize.link(mockScope, [testElement], testAttrs); expect(mockTimeout).toHaveBeenCalledWith( jasmine.any(Function), - jasmine.any(Number) + jasmine.any(Number), + false ); expect(mockScope.$eval).toHaveBeenCalledWith( testAttrs.mctResize, @@ -110,6 +111,35 @@ define( expect(mockTimeout.calls.length).toEqual(2); }); + it("triggers a digest cycle when size changes", function () { + var applyCount; + mctResize.link(mockScope, [testElement], testAttrs); + applyCount = mockScope.$apply.calls.length; + + // Change the element's apparent size + testElement.offsetWidth = 300; + testElement.offsetHeight = 350; + + // Fire the timeout + mockTimeout.mostRecentCall.args[0](); + + // No more apply calls + expect(mockScope.$apply.calls.length) + .toBeGreaterThan(applyCount); + }); + + it("does not trigger a digest cycle when size does not change", function () { + var applyCount; + mctResize.link(mockScope, [testElement], testAttrs); + applyCount = mockScope.$apply.calls.length; + + // Fire the timeout + mockTimeout.mostRecentCall.args[0](); + + // No more apply calls + expect(mockScope.$apply.calls.length).toEqual(applyCount); + }); + }); } -); \ No newline at end of file +); From 0c6a9ca857fc9730c5973aa4165034744e79842e Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Mon, 6 Jul 2015 13:15:38 -0700 Subject: [PATCH 002/266] [Mobile] Styles Added new style to set the width of the tree. --- .../commonUI/browse/res/templates/browse.html | 4 +- .../general/res/css/theme-espresso.css | 113 ++++++++++-------- .../res/sass/user-environ/_layout.scss | 5 + 3 files changed, 71 insertions(+), 51 deletions(-) diff --git a/platform/commonUI/browse/res/templates/browse.html b/platform/commonUI/browse/res/templates/browse.html index 0a7698e8bd..7d87c5f453 100644 --- a/platform/commonUI/browse/res/templates/browse.html +++ b/platform/commonUI/browse/res/templates/browse.html @@ -23,8 +23,8 @@
-
+
+
diff --git a/platform/commonUI/general/res/css/theme-espresso.css b/platform/commonUI/general/res/css/theme-espresso.css index 49c5675a07..ca0fba3fe5 100644 --- a/platform/commonUI/general/res/css/theme-espresso.css +++ b/platform/commonUI/general/res/css/theme-espresso.css @@ -473,7 +473,11 @@ mct-container { -webkit-border-radius: 3px; border-radius: 3px; } -/* line 50, ../sass/user-environ/_layout.scss */ +/* line 51, ../sass/user-environ/_layout.scss */ +.browser-manage { + width: 100%; } + +/* line 55, ../sass/user-environ/_layout.scss */ .contents { box-sizing: border-box; position: absolute; @@ -481,36 +485,36 @@ mct-container { right: 0; bottom: 0; left: 0; } - /* line 58, ../sass/user-environ/_layout.scss */ + /* line 63, ../sass/user-environ/_layout.scss */ .contents.nomargin { right: 0px; bottom: 0px; left: 0px; } -/* line 67, ../sass/user-environ/_layout.scss */ +/* line 72, ../sass/user-environ/_layout.scss */ .bar .icon.major { margin-right: 5px; } -/* line 70, ../sass/user-environ/_layout.scss */ +/* line 75, ../sass/user-environ/_layout.scss */ .bar.abs, .btn-menu span.bar.l-click-area { text-wrap: none; white-space: nowrap; } -/* line 74, ../sass/user-environ/_layout.scss */ +/* line 79, ../sass/user-environ/_layout.scss */ .bar.left, .bar .left { width: 45% !important; right: auto !important; } -/* line 79, ../sass/user-environ/_layout.scss */ +/* line 84, ../sass/user-environ/_layout.scss */ .bar.right, .bar .right { width: 45% !important; left: auto !important; text-align: right; } - /* line 84, ../sass/user-environ/_layout.scss */ + /* line 89, ../sass/user-environ/_layout.scss */ .bar.right .icon.major, .bar .right .icon.major { margin-left: 15px; } -/* line 91, ../sass/user-environ/_layout.scss */ +/* line 96, ../sass/user-environ/_layout.scss */ .user-environ .browse-area, .user-environ .edit-area, .user-environ .editor { @@ -518,23 +522,23 @@ mct-container { right: 10px; bottom: 35px; left: 10px; } -/* line 102, ../sass/user-environ/_layout.scss */ +/* line 107, ../sass/user-environ/_layout.scss */ .user-environ .browse-area > .contents, .user-environ .edit-area > .contents { left: 0; right: 0; } -/* line 108, ../sass/user-environ/_layout.scss */ +/* line 113, ../sass/user-environ/_layout.scss */ .user-environ .edit-area { top: 45px; } - /* line 111, ../sass/user-environ/_layout.scss */ + /* line 116, ../sass/user-environ/_layout.scss */ .user-environ .edit-area .tool-bar { bottom: auto; height: 30px; line-height: 25px; } - /* line 116, ../sass/user-environ/_layout.scss */ + /* line 121, ../sass/user-environ/_layout.scss */ .user-environ .edit-area .work-area { top: 40px; } -/* line 121, ../sass/user-environ/_layout.scss */ +/* line 126, ../sass/user-environ/_layout.scss */ .user-environ .bottom-bar { overflow: hidden; position: absolute; @@ -546,20 +550,20 @@ mct-container { height: auto; top: auto; height: 25px; } - /* line 126, ../sass/user-environ/_layout.scss */ + /* line 131, ../sass/user-environ/_layout.scss */ .user-environ .bottom-bar .status-holder { z-index: 1; } - /* line 130, ../sass/user-environ/_layout.scss */ + /* line 135, ../sass/user-environ/_layout.scss */ .user-environ .bottom-bar .app-logo { left: auto; width: 105px; z-index: 2; } -/* line 138, ../sass/user-environ/_layout.scss */ +/* line 143, ../sass/user-environ/_layout.scss */ .cols { overflow: hidden; *zoom: 1; } - /* line 140, ../sass/user-environ/_layout.scss */ + /* line 145, ../sass/user-environ/_layout.scss */ .cols .col { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; @@ -570,100 +574,100 @@ mct-container { margin-left: 1.5%; padding-left: 5px; position: relative; } - /* line 148, ../sass/user-environ/_layout.scss */ + /* line 153, ../sass/user-environ/_layout.scss */ .cols .col:first-child { margin-left: 0; padding-left: 0; } - /* line 155, ../sass/user-environ/_layout.scss */ + /* line 160, ../sass/user-environ/_layout.scss */ .cols.cols-2 .col-1 { min-width: 250px; width: 48.5%; } - /* line 161, ../sass/user-environ/_layout.scss */ + /* line 166, ../sass/user-environ/_layout.scss */ .cols.cols-2-ff .col-100px { width: 100px; } - /* line 168, ../sass/user-environ/_layout.scss */ + /* line 173, ../sass/user-environ/_layout.scss */ .cols.cols-6 .col-1 { min-width: 83.33333px; width: 15.16667%; } - /* line 174, ../sass/user-environ/_layout.scss */ + /* line 179, ../sass/user-environ/_layout.scss */ .cols.cols-16 .col-1 { min-width: 31.25px; width: 4.75%; } - /* line 177, ../sass/user-environ/_layout.scss */ + /* line 182, ../sass/user-environ/_layout.scss */ .cols.cols-16 .col-2 { min-width: 62.5px; width: 11%; } - /* line 180, ../sass/user-environ/_layout.scss */ + /* line 185, ../sass/user-environ/_layout.scss */ .cols.cols-16 .col-7 { min-width: 218.75px; width: 42.25%; } - /* line 186, ../sass/user-environ/_layout.scss */ + /* line 191, ../sass/user-environ/_layout.scss */ .cols.cols-32 .col-2 { min-width: 31.25px; width: 4.75%; } - /* line 189, ../sass/user-environ/_layout.scss */ + /* line 194, ../sass/user-environ/_layout.scss */ .cols.cols-32 .col-15 { min-width: 234.375px; width: 45.375%; } - /* line 193, ../sass/user-environ/_layout.scss */ + /* line 198, ../sass/user-environ/_layout.scss */ .cols .l-row { overflow: hidden; *zoom: 1; padding: 5px 0; } -/* line 199, ../sass/user-environ/_layout.scss */ +/* line 204, ../sass/user-environ/_layout.scss */ .pane { position: absolute; } - /* line 202, ../sass/user-environ/_layout.scss */ + /* line 207, ../sass/user-environ/_layout.scss */ .pane.treeview .create-btn-holder { bottom: auto; top: 0; height: 24px; } - /* line 205, ../sass/user-environ/_layout.scss */ + /* line 210, ../sass/user-environ/_layout.scss */ .pane.treeview .create-btn-holder .wrapper.menu-element { position: absolute; bottom: 5px; } - /* line 210, ../sass/user-environ/_layout.scss */ + /* line 215, ../sass/user-environ/_layout.scss */ .pane.treeview .tree-holder { overflow: auto; top: 34px; } - /* line 217, ../sass/user-environ/_layout.scss */ + /* line 222, ../sass/user-environ/_layout.scss */ .pane.items .object-browse-bar .left.abs, .pane.items .object-browse-bar .btn-menu span.left.l-click-area, .btn-menu .pane.items .object-browse-bar span.left.l-click-area, .pane.items .object-browse-bar .right.abs, .pane.items .object-browse-bar .btn-menu span.right.l-click-area, .btn-menu .pane.items .object-browse-bar span.right.l-click-area { top: auto; } - /* line 222, ../sass/user-environ/_layout.scss */ + /* line 227, ../sass/user-environ/_layout.scss */ .pane.items .object-holder { top: 34px; } - /* line 227, ../sass/user-environ/_layout.scss */ + /* line 232, ../sass/user-environ/_layout.scss */ .pane.edit-main .object-holder { top: 0; } - /* line 233, ../sass/user-environ/_layout.scss */ + /* line 238, ../sass/user-environ/_layout.scss */ .pane .object-holder { overflow: auto; } -/* line 241, ../sass/user-environ/_layout.scss */ +/* line 246, ../sass/user-environ/_layout.scss */ .split-layout.horizontal > .pane { margin-top: 5px; } - /* line 244, ../sass/user-environ/_layout.scss */ + /* line 249, ../sass/user-environ/_layout.scss */ .split-layout.horizontal > .pane:first-child { margin-top: 0; } -/* line 251, ../sass/user-environ/_layout.scss */ +/* line 256, ../sass/user-environ/_layout.scss */ .split-layout.vertical > .pane { margin-left: 5px; } - /* line 253, ../sass/user-environ/_layout.scss */ + /* line 258, ../sass/user-environ/_layout.scss */ .split-layout.vertical > .pane > .holder { left: 0; right: 0; } - /* line 257, ../sass/user-environ/_layout.scss */ + /* line 262, ../sass/user-environ/_layout.scss */ .split-layout.vertical > .pane:first-child { margin-left: 0; } - /* line 259, ../sass/user-environ/_layout.scss */ + /* line 264, ../sass/user-environ/_layout.scss */ .split-layout.vertical > .pane:first-child .holder { right: 5px; } -/* line 268, ../sass/user-environ/_layout.scss */ +/* line 273, ../sass/user-environ/_layout.scss */ .vscroll { overflow-y: auto; } @@ -1256,26 +1260,37 @@ mct-container { .tabular tr td, .tabular tr .td, .tabular .tr td, .tabular .tr .td { border-top: 1px solid rgba(255, 255, 255, 0.1); min-width: 110px; + color: #fff; padding: 2px 5px; vertical-align: top; } - /* line 107, ../sass/lists/_tabular.scss */ + /* line 108, ../sass/lists/_tabular.scss */ .tabular tr td.numeric, .tabular tr .td.numeric, .tabular .tr td.numeric, .tabular .tr .td.numeric { text-align: right; } - /* line 113, ../sass/lists/_tabular.scss */ + /* line 111, ../sass/lists/_tabular.scss */ + .tabular tr td.s-cell-type-value, .tabular tr .td.s-cell-type-value, .tabular .tr td.s-cell-type-value, .tabular .tr .td.s-cell-type-value { + text-align: right; } + /* line 113, ../sass/lists/_tabular.scss */ + .tabular tr td.s-cell-type-value .l-cell-contents, .tabular tr .td.s-cell-type-value .l-cell-contents, .tabular .tr td.s-cell-type-value .l-cell-contents, .tabular .tr .td.s-cell-type-value .l-cell-contents { + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + padding-left: 5px; + padding-right: 5px; } + /* line 122, ../sass/lists/_tabular.scss */ .tabular.filterable tbody, .tabular.filterable .tbody { top: 36px; } - /* line 118, ../sass/lists/_tabular.scss */ + /* line 127, ../sass/lists/_tabular.scss */ .tabular.fixed-header { height: 100%; } - /* line 120, ../sass/lists/_tabular.scss */ + /* line 129, ../sass/lists/_tabular.scss */ .tabular.fixed-header thead, .tabular.fixed-header .thead, .tabular.fixed-header tbody tr, .tabular.fixed-header .tbody .tr { display: table; table-layout: fixed; } - /* line 125, ../sass/lists/_tabular.scss */ + /* line 134, ../sass/lists/_tabular.scss */ .tabular.fixed-header thead, .tabular.fixed-header .thead { width: calc(100% - 10px); } - /* line 128, ../sass/lists/_tabular.scss */ + /* line 137, ../sass/lists/_tabular.scss */ .tabular.fixed-header tbody, .tabular.fixed-header .tbody { overflow: hidden; position: absolute; @@ -1288,7 +1303,7 @@ mct-container { top: 18px; display: block; overflow-y: scroll; } - /* line 136, ../sass/lists/_tabular.scss */ + /* line 145, ../sass/lists/_tabular.scss */ .tabular.t-event-messages td, .tabular.t-event-messages .td { min-width: 150px; } diff --git a/platform/commonUI/general/res/sass/user-environ/_layout.scss b/platform/commonUI/general/res/sass/user-environ/_layout.scss index 639e53af75..d6e6f9b6cb 100644 --- a/platform/commonUI/general/res/sass/user-environ/_layout.scss +++ b/platform/commonUI/general/res/sass/user-environ/_layout.scss @@ -47,6 +47,11 @@ @include border-radius($basicCr * 1.5); } +// style="min-width: 150px; max-width: 800px; width: 25%;" +.browser-manage { + width: 100%; +} + .contents { $myM: 0; //$interiorMargin; box-sizing: border-box; From d8806f14aab7d3994e0d96dbf1cacacb9a7abb6a Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Tue, 7 Jul 2015 09:08:16 -0700 Subject: [PATCH 003/266] [Mobile] Set viewport Viewport has been set in index.html. Then what was implemented prior to this (rem-display and browser-manage) was commented out. --- index.html | 1 + .../commonUI/browse/res/templates/browse.html | 3 +- .../general/res/css/theme-espresso.css | 92 ++++++++++--------- .../res/sass/user-environ/_layout.scss | 22 ++++- 4 files changed, 70 insertions(+), 48 deletions(-) diff --git a/index.html b/index.html index cb9e6623a7..a8c258db30 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,7 @@ +