Repository: ignite Updated Branches: refs/heads/master ffe7cbc40 -> 19772109d
IGNITE-10490 Web Console: Fixed ui-grid refresh on its parent element resize. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/19772109 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/19772109 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/19772109 Branch: refs/heads/master Commit: 19772109d83c0caa348b9522135ea1f2e8463354 Parents: ffe7cbc Author: Alexander Kalinin <[email protected]> Authored: Fri Nov 30 17:38:53 2018 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Fri Nov 30 17:38:53 2018 +0700 ---------------------------------------------------------------------- .../frontend/app/components/ui-grid/controller.js | 10 ++++++++++ .../frontend/app/components/ui-grid/style.scss | 1 + modules/web-console/frontend/app/vendor.js | 2 ++ modules/web-console/frontend/package.json | 3 ++- 4 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/19772109/modules/web-console/frontend/app/components/ui-grid/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/ui-grid/controller.js b/modules/web-console/frontend/app/components/ui-grid/controller.js index f53416b..ec7101b 100644 --- a/modules/web-console/frontend/app/components/ui-grid/controller.js +++ b/modules/web-console/frontend/app/components/ui-grid/controller.js @@ -18,6 +18,8 @@ import debounce from 'lodash/debounce'; import headerTemplate from 'app/primitives/ui-grid-header/index.tpl.pug'; +import ResizeObserver from 'resize-observer-polyfill'; + export default class IgniteUiGrid { /** @type {import('ui-grid').IGridOptions} */ grid; @@ -129,6 +131,9 @@ export default class IgniteUiGrid { this.$timeout(() => { if (this.selectedRowsId) this.applyIncomingSelectionRowsId(this.selectedRowsId); }); + + this.resizeObserver = new ResizeObserver(() => api.core.handleWindowResize()); + this.resizeObserver.observe(this.$element[0]); } }; @@ -153,6 +158,11 @@ export default class IgniteUiGrid { this.adjustHeight(); } + $onDestroy() { + if (this.resizeObserver) + this.resizeObserver.disconnect(); + } + applyIncomingSelectionRows = (selected = []) => { this.gridApi.selection.clearSelectedRows({ ignore: true }); http://git-wip-us.apache.org/repos/asf/ignite/blob/19772109/modules/web-console/frontend/app/components/ui-grid/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/ui-grid/style.scss b/modules/web-console/frontend/app/components/ui-grid/style.scss index dba5d35..da31f67 100644 --- a/modules/web-console/frontend/app/components/ui-grid/style.scss +++ b/modules/web-console/frontend/app/components/ui-grid/style.scss @@ -18,6 +18,7 @@ .ignite-grid-table, ignite-grid-table { @import 'public/stylesheets/variables'; + display: block; .ui-grid.ui-grid--ignite.ui-grid--thin { // Start section row height. http://git-wip-us.apache.org/repos/asf/ignite/blob/19772109/modules/web-console/frontend/app/vendor.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/vendor.js b/modules/web-console/frontend/app/vendor.js index 6961e96..90808be 100644 --- a/modules/web-console/frontend/app/vendor.js +++ b/modules/web-console/frontend/app/vendor.js @@ -28,6 +28,8 @@ import 'angular-messages'; import '@uirouter/angularjs'; import '@uirouter/angularjs/lib/legacy/stateEvents'; +import 'resize-observer-polyfill'; + import 'tf-metatags'; import 'angular-translate'; import 'angular-smart-table'; http://git-wip-us.apache.org/repos/asf/ignite/blob/19772109/modules/web-console/frontend/package.json ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/package.json b/modules/web-console/frontend/package.json index 9059a5f..e8f4ae2 100644 --- a/modules/web-console/frontend/package.json +++ b/modules/web-console/frontend/package.json @@ -68,6 +68,7 @@ "nvd3": "1.8.6", "outdent": "0.5.0", "pako": "1.0.6", + "resize-observer-polyfill": "1.5.0", "roboto-font": "0.1.0", "rxjs": "5.5.11", "socket.io-client": "1.7.3", @@ -129,7 +130,7 @@ "mocha": "3.4.2", "mocha-teamcity-reporter": "1.1.1", "node-fetch": "1.7.3", - "node-sass": "4.9.3", + "node-sass": "4.10.0", "progress": "2.0.0", "progress-bar-webpack-plugin": "1.11.0", "pug-html-loader": "1.1.0",
