-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.13.1' into master
- Loading branch information
Showing
8 changed files
with
123 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/** | ||
* ng-handsontable 0.13.0 | ||
* ng-handsontable 0.13.1 | ||
* | ||
* Copyright 2012-2015 Marcin Warpechowski | ||
* Copyright 2015 Handsoncode sp. z o.o. <[email protected]> | ||
* Licensed under the MIT license. | ||
* https://github.com/handsontable/ngHandsontable | ||
* Date: Wed Oct 26 2016 10:00:05 GMT+0200 (CEST) | ||
* Date: Thu Aug 20 2020 11:07:09 GMT+0200 (CEST) | ||
*/ | ||
|
||
if (document.all && !document.addEventListener) { // IE 8 and lower | ||
|
@@ -470,6 +470,10 @@ Handsontable.hooks.add('afterContextMenuShow', function() { | |
settingFactory.updateHandsontableSettings($scope.hotInstance, $scope.htSettings); | ||
}; | ||
this.removeColumnSetting = function(column) { | ||
if (!$scope.hotInstance) { | ||
return; | ||
} | ||
|
||
if ($scope.htSettings.columns.indexOf(column) > -1) { | ||
$scope.htSettings.columns.splice($scope.htSettings.columns.indexOf(column), 1); | ||
settingFactory.updateHandsontableSettings($scope.hotInstance, $scope.htSettings); | ||
|
@@ -597,6 +601,24 @@ Handsontable.hooks.add('afterContextMenuShow', function() { | |
settingFactory.updateHandsontableSettings(scope.hotInstance, scope.htSettings); | ||
} | ||
}); | ||
|
||
function destroyInstance() { | ||
if (scope.hotInstance) { | ||
scope.hotInstance.destroy(); | ||
scope.hotInstance = null; | ||
scope.htSettings = {}; | ||
} | ||
} | ||
|
||
// Destroy triggered by controller or scope destroying | ||
scope.$on('$destroy', function() { | ||
destroyInstance(); | ||
}); | ||
|
||
// Destroy triggered by DOM element removing | ||
element.on('$destroy', function() { | ||
destroyInstance(); | ||
}); | ||
}; | ||
} | ||
}; | ||
|
Oops, something went wrong.