angular.module("umbraco.directives.html")
    .directive('umbEditorHeader', function (iconHelper) {
        return {
            transclude: true,
            restrict: 'E',
            replace: true,
            scope: {
                tabs: "=",
                actions: "=",
                name: "=",
                menu: "=",
                icon: "=",
                alias: "=",
                description: "=",
                navigation: "="
            },
            templateUrl: 'views/components/editor/umb-editor-header.html',
            link: function(scope, elem, attrs, ctrl) {

                scope.openIconPicker = function() {

                    scope.dialogModel = {};
                    scope.dialogModel.title = "Choose icon";
                    scope.dialogModel.view = "views/documenttype/dialogs/iconpicker/iconpicker.html";
                    scope.showDialog = true;

                    scope.dialogModel.pickIcon = function(icon, color) {

                        if(color) {
                            scope.icon = icon + " " + color;
                        } else {
                            scope.icon = icon;
                        }

                        scope.showDialog = false;
                        scope.dialogModel = null;

                    };

                    scope.dialogModel.close = function(){
                        scope.showDialog = false;
                        scope.dialogModel = null;
                    };

                };

            }
        };
    });
@@ -1,565 +1,90 @@
-angular.module(%22umbraco.directives.html%22)%0A    .directive('umbEditorHeader', function (iconHelper) %7B%0A        return %7B%0A            transclude: true,%0A            restrict: 'E',%0A            replace: true,%0A            scope: %7B%0A                tabs: %22=%22,%0A                actions: %22=%22,%0A                name: %22=%22,%0A                menu: %22=%22,%0A                icon: %22=%22,%0A                alias: %22=%22,%0A                description: %22=%22,%0A                navigation: %22=%22%0A            %7D,%0A            templateUrl: 'views/components/editor/umb-editor-header.html',%0A            link:
+(function() %7B%0A   'use strict';%0A%0A   function EditorHeaderDirective(iconHelper) %7B%0A%0A     
  fun
@@ -88,16 +88,21 @@
 function
+ link
 (scope, 
@@ -107,17 +107,14 @@
 , el
-em
 , attr
-s
 , ct
@@ -125,31 +125,24 @@
 %7B%0A%0A         
-       
 scope.openIc
@@ -174,32 +174,24 @@
             
-        
 scope.dialog
@@ -210,32 +210,24 @@
             
-    
-    
 scope.dialog
@@ -255,24 +255,16 @@
  icon%22;%0A
-        
         
@@ -357,32 +357,24 @@
             
-       
- 
 scope.showDi
@@ -387,24 +387,16 @@
  true;%0A%0A
-        
         
@@ -472,19 +472,11 @@
     
-         
 if
+ 
 (col
@@ -495,34 +495,24 @@
             
-          
 scope.icon =
@@ -547,25 +547,16 @@
         
-        
- 
 %7D else %7B
@@ -556,26 +556,16 @@
  else %7B%0A
-          
         
@@ -612,29 +612,11 @@
     
-        
- 
 %7D%0A%0A
-         
     
@@ -648,33 +648,24 @@
 og = false;%0A
-         
             
@@ -706,36 +706,20 @@
         
-        %7D;%0A%0A        
+%7D;%0A%0A
         
@@ -758,16 +758,17 @@
 nction()
+ 
 %7B%0A      
@@ -772,33 +772,24 @@
             
-  
-       
 scope.showDi
@@ -798,33 +798,24 @@
 og = false;%0A
-         
             
@@ -846,32 +846,37 @@
 ull;%0A           
+ %7D;%0A%0A
          %7D;%0A%0A   
@@ -878,33 +878,408 @@
 %0A%0A      
+%7D%0A%0A
       
-    %7D;%0A%0A   
+var directive = %7B%0A         transclude: true,%0A         restrict: 'E',%0A         replace: true,%0A         templateUrl: 'views/components/editor/umb-editor-header.html',%0A         scope: %7B%0A            tabs: %22=%22,%0A            actions: %22=%22,%0A            name: %22=%22,%0A            menu: %22=%22,%0A            icon: %22=%22,%0A            alias: %22=%22,%0A            description: %22=%22,%0A            navigation: %22=%22%0A
         
@@ -1280,16 +1280,17 @@
        %7D
+,
 %0A       
@@ -1294,14 +1294,156 @@
     
-%7D;%0A    %7D);
+ link: link%0A      %7D;%0A%0A      return directive;%0A   %7D%0A%0A   angular.module('umbraco.directives').directive('umbEditorHeader', EditorHeaderDirective);%0A%0A%7D)();%0A

refactor umb editor header directive to follow angular style guide