mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
added comments that explicitly label the modified section, and detail where to find the original code so that we can maintain some parity down the road
This commit is contained in:
parent
34c7272bad
commit
642d492597
1 changed files with 18 additions and 0 deletions
|
@ -3,6 +3,14 @@ define(function (require) {
|
|||
|
||||
angular
|
||||
.module('kibana/directives')
|
||||
/******
|
||||
****** COPIED directive from angular-router
|
||||
****** https://github.com/angular/angular.js/blob/6f0503514f/src/ngRoute/directive/ngView.js#L183
|
||||
******
|
||||
****** Modification made:
|
||||
****** - prevent the view from being recreated unnecessarily
|
||||
******
|
||||
******/
|
||||
.directive('kbnView', function modifiedNgViewFactory($route, $anchorScroll, $animate) {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
|
@ -31,6 +39,7 @@ define(function (require) {
|
|||
}
|
||||
|
||||
function update() {
|
||||
/****** START modification *******/
|
||||
if ($route.current) {
|
||||
if (currentTemplateUrl && $route.current.templateUrl === currentTemplateUrl) {
|
||||
return;
|
||||
|
@ -38,6 +47,7 @@ define(function (require) {
|
|||
currentTemplateUrl = $route.current.templateUrl;
|
||||
}
|
||||
}
|
||||
/****** STOP modification *******/
|
||||
|
||||
var locals = $route.current && $route.current.locals;
|
||||
var template = locals && locals.$template;
|
||||
|
@ -73,6 +83,14 @@ define(function (require) {
|
|||
}
|
||||
};
|
||||
})
|
||||
|
||||
/******
|
||||
****** COPIED directive from angular-router
|
||||
****** https://github.com/angular/angular.js/blob/6f0503514f/src/ngRoute/directive/ngView.js#L251
|
||||
******
|
||||
****** No Modifications made
|
||||
******
|
||||
******/
|
||||
.directive('kbnView', function modifiedNgViewFillContentFactory($compile, $controller, $route) {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue