This is an automated email from the ASF dual-hosted git repository.

iuliana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new e5e60d0  Expose the CodeMirror instance that can be accessed via a 
specific event `brooklyn.component.yaml-editor.cm`
     new 2664181  Merge pull request #182 from tbouron/feature/expose-codemirror
e5e60d0 is described below

commit e5e60d0b8b2f7b9a02109663819905993ee367f7
Author: Thomas Bouron <[email protected]>
AuthorDate: Thu Dec 17 13:48:26 2020 +0000

    Expose the CodeMirror instance that can be accessed via a specific event 
`brooklyn.component.yaml-editor.cm`
---
 ui-modules/utils/yaml-editor/yaml-editor.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ui-modules/utils/yaml-editor/yaml-editor.js 
b/ui-modules/utils/yaml-editor/yaml-editor.js
index 2fe1f7b..a9c1b57 100644
--- a/ui-modules/utils/yaml-editor/yaml-editor.js
+++ b/ui-modules/utils/yaml-editor/yaml-editor.js
@@ -177,5 +177,11 @@ export function yamlEditorDirective($rootScope, 
brSnackbar) {
                 $scope.cm.refresh();
             });
         });
+
+        $scope.$on(`${MODULE_NAME}.cm`, callback => {
+            if (angular.isFunction(callback)) {
+                callback.apply(null, [$scope.cm]);
+            }
+        });
     }
 }

Reply via email to