Skip to content

Commit be9c015

Browse files
committed
This fixes #72 "replace jQuery's $.extend"
1 parent 3dc3b6f commit be9c015

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

dist/angular-patternfly.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ["c3ChartDefaul
787787
$scope.config.tooltip = donutTooltip(scope);
788788
};
789789

790-
$scope.config = $.extend(true, c3ChartDefaults.getDefaultDonutConfig(), $scope.config);
790+
$scope.config = angular.merge({}, c3ChartDefaults.getDefaultDonutConfig(), $scope.config);
791791
$scope.updateAll($scope);
792792
}
793793
],
@@ -1121,7 +1121,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ["c3ChartDefau
11211121
$scope.defaultConfig.units = '';
11221122

11231123
// Override defaults with callers specifications
1124-
$scope.config = $.extend(true, angular.copy($scope.defaultConfig), $scope.config);
1124+
$scope.config = angular.merge({},$scope.defaultConfig, $scope.config);
11251125

11261126
// Convert the given data to C3 chart format
11271127
$scope.config.data = $scope.getSparklineData($scope.chartData);
@@ -1130,7 +1130,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ["c3ChartDefau
11301130

11311131
link: function (scope) {
11321132
scope.$watch('config', function () {
1133-
scope.config = $.extend(true, angular.copy(scope.defaultConfig), scope.config);
1133+
scope.config = angular.merge({}, scope.defaultConfig, scope.config);
11341134
}, true);
11351135
scope.$watch('chartHeight', function () {
11361136
scope.config.size.height = scope.chartHeight;
@@ -1674,7 +1674,7 @@ angular.module('patternfly.filters').directive('pfSimpleFilter',
16741674
};
16751675

16761676
$scope.setupConfig = function () {
1677-
$scope.config = $.extend(true, angular.copy(defaultConfig), $scope.config);
1677+
$scope.config = angular.merge({}, defaultConfig, $scope.config);
16781678

16791679
if (!$scope.currentField) {
16801680
$scope.currentField = $scope.config.fields[0];
@@ -2998,7 +2998,7 @@ angular.module('patternfly.views').directive('pfDataList', [
29982998
onDblClick: null
29992999
};
30003000

3001-
$scope.config = $.extend(true, angular.copy($scope.defaultConfig), $scope.config);
3001+
$scope.config = angular.merge({}, $scope.defaultConfig, $scope.config);
30023002
if ($scope.config.selectItems && $scope.config.showSelectBox) {
30033003
throw new Error('pfDataList - ' +
30043004
'Illegal use of pfDataList directive! ' +
@@ -3009,7 +3009,7 @@ angular.module('patternfly.views').directive('pfDataList', [
30093009

30103010
link: function (scope, element, attrs) {
30113011
attrs.$observe('config', function () {
3012-
scope.config = $.extend(true, angular.copy(scope.defaultConfig), scope.config);
3012+
scope.config = angular.merge({}, scope.defaultConfig, scope.config);
30133013
if (!scope.config.selectItems) {
30143014
scope.config.selectedItems = [];
30153015
}
@@ -3324,7 +3324,7 @@ angular.module('patternfly.views').directive('pfDataTiles', [
33243324
onDblClick: null
33253325
};
33263326

3327-
$scope.config = $.extend(true, angular.copy($scope.defaultConfig), $scope.config);
3327+
$scope.config = angular.merge({}, $scope.defaultConfig, $scope.config);
33283328
if ($scope.config.selectItems && $scope.config.showSelectBox) {
33293329
throw new Error('pfDataTiles - ' +
33303330
'Illegal use of pfDataTiles directive! ' +
@@ -3333,7 +3333,7 @@ angular.module('patternfly.views').directive('pfDataTiles', [
33333333
}],
33343334
link: function (scope, element, attrs) {
33353335
attrs.$observe('config', function () {
3336-
scope.config = $.extend(true, angular.copy(scope.defaultConfig), scope.config);
3336+
scope.config = angular.merge({}, scope.defaultConfig, scope.config);
33373337
if (!scope.config.selectItems) {
33383338
scope.config.selectedItems = [];
33393339
}

dist/angular-patternfly.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/charts/donut/donut-pct-chart-directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', function (c3Cha
331331
$scope.config.tooltip = donutTooltip(scope);
332332
};
333333

334-
$scope.config = $.extend(true, c3ChartDefaults.getDefaultDonutConfig(), $scope.config);
334+
$scope.config = angular.merge({}, c3ChartDefaults.getDefaultDonutConfig(), $scope.config);
335335
$scope.updateAll($scope);
336336
}
337337
],

src/charts/sparkline/sparkline-chart.directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', function (c3Ch
286286
$scope.defaultConfig.units = '';
287287

288288
// Override defaults with callers specifications
289-
$scope.config = $.extend(true, angular.copy($scope.defaultConfig), $scope.config);
289+
$scope.config = angular.merge({},$scope.defaultConfig, $scope.config);
290290

291291
// Convert the given data to C3 chart format
292292
$scope.config.data = $scope.getSparklineData($scope.chartData);
@@ -295,7 +295,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', function (c3Ch
295295

296296
link: function (scope) {
297297
scope.$watch('config', function () {
298-
scope.config = $.extend(true, angular.copy(scope.defaultConfig), scope.config);
298+
scope.config = angular.merge({}, scope.defaultConfig, scope.config);
299299
}, true);
300300
scope.$watch('chartHeight', function () {
301301
scope.config.size.height = scope.chartHeight;

src/filters/simple-filter-directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ angular.module('patternfly.filters').directive('pfSimpleFilter',
186186
};
187187

188188
$scope.setupConfig = function () {
189-
$scope.config = $.extend(true, angular.copy(defaultConfig), $scope.config);
189+
$scope.config = angular.merge({}, defaultConfig, $scope.config);
190190

191191
if (!$scope.currentField) {
192192
$scope.currentField = $scope.config.fields[0];

src/views/datalist/data-list-directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ angular.module('patternfly.views').directive('pfDataList', [
222222
onDblClick: null
223223
};
224224

225-
$scope.config = $.extend(true, angular.copy($scope.defaultConfig), $scope.config);
225+
$scope.config = angular.merge({}, $scope.defaultConfig, $scope.config);
226226
if ($scope.config.selectItems && $scope.config.showSelectBox) {
227227
throw new Error('pfDataList - ' +
228228
'Illegal use of pfDataList directive! ' +
@@ -233,7 +233,7 @@ angular.module('patternfly.views').directive('pfDataList', [
233233

234234
link: function (scope, element, attrs) {
235235
attrs.$observe('config', function () {
236-
scope.config = $.extend(true, angular.copy(scope.defaultConfig), scope.config);
236+
scope.config = angular.merge({}, scope.defaultConfig, scope.config);
237237
if (!scope.config.selectItems) {
238238
scope.config.selectedItems = [];
239239
}

src/views/datatiles/data-tiles-directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ angular.module('patternfly.views').directive('pfDataTiles', [
219219
onDblClick: null
220220
};
221221

222-
$scope.config = $.extend(true, angular.copy($scope.defaultConfig), $scope.config);
222+
$scope.config = angular.merge({}, $scope.defaultConfig, $scope.config);
223223
if ($scope.config.selectItems && $scope.config.showSelectBox) {
224224
throw new Error('pfDataTiles - ' +
225225
'Illegal use of pfDataTiles directive! ' +
@@ -228,7 +228,7 @@ angular.module('patternfly.views').directive('pfDataTiles', [
228228
},
229229
link: function (scope, element, attrs) {
230230
attrs.$observe('config', function () {
231-
scope.config = $.extend(true, angular.copy(scope.defaultConfig), scope.config);
231+
scope.config = angular.merge({}, scope.defaultConfig, scope.config);
232232
if (!scope.config.selectItems) {
233233
scope.config.selectedItems = [];
234234
}

test/charts/sparkline/sparkline-chart.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('Directive: pfSparklineChart', function() {
105105

106106
expect(isolateScope.config.data.x).toBe("dates");
107107
expect(isolateScope.config.data.columns.length).toBe(2);
108-
expect(isolateScope.config.data.columns[0][1]).toBe($scope.data.xData[1]);
108+
expect(isolateScope.config.data.columns[0][1].toString()).toBe($scope.data.xData[1].toString());
109109
expect(isolateScope.config.data.columns[1][1]).toBe('10');
110110

111111
var now = new Date();
@@ -114,7 +114,7 @@ describe('Directive: pfSparklineChart', function() {
114114

115115
$scope.$digest();
116116

117-
expect(isolateScope.config.data.columns[0][1]).toBe(now);
117+
expect(isolateScope.config.data.columns[0][1].toString()).toBe(now.toString());
118118
expect(isolateScope.config.data.columns[1][1]).toBe('1000');
119119
});
120120

0 commit comments

Comments
 (0)