Skip to content

Commit

Permalink
Merge pull request ngageoint#967 in WV/opensphere from ~SALANKEYJ/ope…
Browse files Browse the repository at this point in the history
…nsphere:THIN-14400 to release

* commit '97343b1ace4218b6593fcc1fa7f6eb72f07a3c04':
  fix(slickgrid): adds workaround event for handling broken resize cases
  • Loading branch information
jsalankey committed Oct 16, 2019
2 parents 37c8dcc + 97343b1 commit 284a4f6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/os/ui/slick/slickgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ goog.require('os.events');
goog.require('os.string');
goog.require('os.ui');
goog.require('os.ui.Module');
goog.require('os.ui.ResizeEventType');
goog.require('os.ui.column.columnManagerDirective');
goog.require('os.ui.globalMenuDirective');
goog.require('os.ui.menu.IMenuSupplier');
Expand Down Expand Up @@ -253,6 +254,7 @@ os.ui.slick.SlickGridCtrl = function($scope, $element, $compile) {
$scope.$on(os.ui.slick.SlickGridEvent.SCROLL_TO_CELL, this.onScrollToCell.bind(this));
$scope.$on(os.ui.slick.SlickGridEvent.SORT_SELECTED, this.onSortBySelectionChange.bind(this));
$scope.$on('resize', this.resizeFn);
$scope.$on(os.ui.ResizeEventType.UPDATE_RESIZE, this.onUpdateResize.bind(this));

$scope['cellTooltips'] = $scope['cellTooltips'] == undefined ? true : $scope['cellTooltips'];

Expand Down Expand Up @@ -646,6 +648,17 @@ os.ui.slick.SlickGridCtrl.prototype.doResize = function() {
};


/**
* Handler for updating the resize listener. This is needed due to cases where the resize listener breaks.
* @private
*/
os.ui.slick.SlickGridCtrl.prototype.onUpdateResize = function() {
os.ui.removeResize(this.element, this.resizeFn);
os.ui.resize(this.element, this.resizeFn);
};



/**
* Copys rows in the grid.
*
Expand Down
10 changes: 10 additions & 0 deletions src/os/ui/ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
goog.provide('os.ui');
goog.provide('os.ui.Module');
goog.provide('os.ui.ResizeEventType');

goog.require('goog.events.EventTarget');
goog.require('goog.html.SafeHtml');
Expand Down Expand Up @@ -286,6 +287,15 @@ os.ui.removeResize = function(el, fn) {
};


/**
* Enumeration of resize event types.
* @enum {string}
*/
os.ui.ResizeEventType = {
UPDATE_RESIZE: 'updateResize'
};


/**
* Replace a directive already registered with Angular. The directive name and module should be identical to the
* original.
Expand Down

0 comments on commit 284a4f6

Please sign in to comment.