Repository: brooklyn-ui
Updated Branches:
  refs/heads/master fb77f723f -> c2c63714d


spec editor hook


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/686369af
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/686369af
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/686369af

Branch: refs/heads/master
Commit: 686369afc97e52877caf4e6aed7513904759bca8
Parents: 88c36c3
Author: frogfather <j.a.campb...@icloud.com>
Authored: Wed Oct 24 09:36:18 2018 +0100
Committer: frogfather <j.a.campb...@icloud.com>
Committed: Wed Oct 24 09:47:52 2018 +0100

----------------------------------------------------------------------
 .../app/components/spec-editor/spec-editor.directive.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/686369af/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
----------------------------------------------------------------------
diff --git 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
index 7f2dcba..e1ef2b5 100644
--- 
a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
+++ 
b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
@@ -34,7 +34,7 @@ const ANY_MEMBERSPEC_REGEX = /(^.*[m,M]ember[s,S]pec$)/;
 const REPLACED_DSL_ENTITYSPEC = '___brooklyn:entitySpec';
 
 angular.module(MODULE_NAME, [onEnter, autoGrow, blurOnEnter, 
brooklynDslEditor, brooklynDslViewer])
-    .directive('specEditor', ['$rootScope', '$templateCache', '$injector', 
'$sanitize', '$filter', '$log', '$sce', '$timeout', '$document', '$state', 
'blueprintService', specEditorDirective])
+    .directive('specEditor', ['$rootScope', '$templateCache', '$injector', 
'$sanitize', '$filter', '$log', '$sce', '$timeout', '$document', '$state', 
'blueprintService', composerOverrides, specEditorDirective])
     .filter('specEditorConfig', specEditorConfigFilter)
     .filter('specEditorType', specEditorTypeFilter);
 
@@ -72,7 +72,7 @@ export const CONFIG_FILTERS = [
     }
 ];
 
-export function specEditorDirective($rootScope, $templateCache, $injector, 
$sanitize, $filter, $log, $sce, $timeout, $document, $state, blueprintService) {
+export function specEditorDirective($rootScope, $templateCache, $injector, 
$sanitize, $filter, $log, $sce, $timeout, $document, $state, blueprintService, 
composerOverrides) {
     return {
         restrict: 'E',
         scope: {
@@ -130,7 +130,13 @@ export function specEditorDirective($rootScope, 
$templateCache, $injector, $sani
                 open: false
             }
         };
-
+        // allow downstream to configure this controller and/or scope
+        (composerOverrides.configureSpecEditor || function() {})(this, $scope, 
$element);
+        var headerTemplate = 
angular.element($templateCache.get('spec-editor/header.html'));
+        if (headerTemplate){
+            var compiledHTML = $compile(headerTemplate[0])(scope)
+            
element[0].querySelector('.spec-type-header').append(compiledHTML[0]);
+        }
         scope.filters = {
             config: CONFIG_FILTERS
         };

Reply via email to