|
|
@@ -34,9 +34,8 @@ function() {
|
|
|
};
|
|
|
})
|
|
|
|
|
|
-.directive("layout", [
|
|
|
-"$window", "$compile", "LayoutService",
|
|
|
-function($window, $compile, Layout) {
|
|
|
+.directive("layout",
|
|
|
+function($window, $compile, LayoutService) {
|
|
|
return {
|
|
|
restrict: "E",
|
|
|
scope: true,
|
|
|
@@ -54,23 +53,23 @@ function($window, $compile, Layout) {
|
|
|
dimensions: scope.model.dimensions,
|
|
|
content: scope.model.data,
|
|
|
};
|
|
|
- Layout.setLayout(scope.goldenLayoutConfig, element);
|
|
|
+ LayoutService.setLayout(scope.goldenLayoutConfig, element);
|
|
|
Object.keys(scope.templates).forEach(function(tmplName) {
|
|
|
var tmpl = scope.templates[tmplName];
|
|
|
- Layout.goldenLayout.registerComponent(tmplName, function(container, state) {
|
|
|
+ LayoutService.goldenLayout.registerComponent(tmplName, function(container, state) {
|
|
|
var element = container.getElement();
|
|
|
element.html(tmpl);
|
|
|
$compile(element.contents())(scope.$parent);
|
|
|
});
|
|
|
});
|
|
|
- Layout.goldenLayout.registerComponent("angularTemplate", function createAngularTemplate(container, state) {
|
|
|
+ LayoutService.goldenLayout.registerComponent("angularTemplate", function createAngularTemplate(container, state) {
|
|
|
var element = container.getElement();
|
|
|
element.html(state.template);
|
|
|
if (typeof state.template === "string") {
|
|
|
$compile(element.contents())(scope.$parent);
|
|
|
}
|
|
|
});
|
|
|
- Layout.goldenLayout.init();
|
|
|
+ LayoutService.goldenLayout.init();
|
|
|
|
|
|
scope.$watch(
|
|
|
function getDimensions() {
|
|
|
@@ -81,7 +80,7 @@ function($window, $compile, Layout) {
|
|
|
},
|
|
|
function onDimensionsChanged(dim, oldDim) {
|
|
|
if (!dim) return;
|
|
|
- Layout.goldenLayout.updateSize(dim.w, dim.h);
|
|
|
+ LayoutService.goldenLayout.updateSize(dim.w, dim.h);
|
|
|
},
|
|
|
true //deep
|
|
|
);
|
|
|
@@ -99,8 +98,7 @@ function($window, $compile, Layout) {
|
|
|
};
|
|
|
},
|
|
|
};
|
|
|
-},
|
|
|
-])
|
|
|
+})
|
|
|
|
|
|
.directive("layoutRow", function() {
|
|
|
return {
|