From bdc13ef70690e763294ed68d148964348a012cc4 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Tue, 25 Feb 2014 09:07:40 -0700 Subject: [PATCH] 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 --- src/kibana/directives/kbn_view.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/kibana/directives/kbn_view.js b/src/kibana/directives/kbn_view.js index 5a753477efdc..eae3f211c935 100644 --- a/src/kibana/directives/kbn_view.js +++ b/src/kibana/directives/kbn_view.js @@ -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',