-
+
diff --git a/merlin/static/merlin/js/merlin.directives.js b/merlin/static/merlin/js/merlin.directives.js
index ace9c56..fa0e69d 100644
--- a/merlin/static/merlin/js/merlin.directives.js
+++ b/merlin/static/merlin/js/merlin.directives.js
@@ -41,6 +41,7 @@
* */
.directive('typedField', typedField)
+ .directive('editableTitle', editableTitle)
.directive('labeled', labeled);
function labeled() {
@@ -49,12 +50,27 @@
templateUrl: '/static/merlin/templates/labeled.html',
transclude: true,
scope: {
- label: '@',
+ label: '=',
for: '@'
}
};
}
+ function editableTitle() {
+ return {
+ restrict: 'E',
+ templateUrl: '/static/merlin/templates/title.html',
+ scope: {
+ ngModel: '='
+ },
+ link: function(scope) {
+ if (angular.isFunction(scope.ngModel)) {
+ scope.editable = true;
+ }
+ }
+ };
+ }
+
function editable() {
return {
restrict: 'E',
@@ -136,12 +152,7 @@
panel: '=content'
},
link: function(scope) {
- if (angular.isDefined(scope.panel)) {
- scope.isCollapsed = false;
- if (angular.isFunction(scope.panel.title)) {
- scope.editable = true;
- }
- }
+ scope.isCollapsed = false;
}
};
}
@@ -152,16 +163,12 @@
templateUrl: '/static/merlin/templates/collapsible-group.html',
transclude: true,
scope: {
- group: '=content',
title: '=',
onAdd: '&',
onRemove: '&'
},
link: function(scope, element, attrs) {
scope.isCollapsed = false;
- if (angular.isFunction(scope.title)) {
- scope.editable = true;
- }
if ( attrs.onAdd && attrs.additive !== 'false' ) {
scope.additive = true;
}
diff --git a/merlin/static/merlin/templates/collapsible-group.html b/merlin/static/merlin/templates/collapsible-group.html
index b549d9b..a29f3c4 100644
--- a/merlin/static/merlin/templates/collapsible-group.html
+++ b/merlin/static/merlin/templates/collapsible-group.html
@@ -3,9 +3,7 @@
diff --git a/merlin/static/merlin/templates/collapsible-panel.html b/merlin/static/merlin/templates/collapsible-panel.html
index e321d6f..b38798e 100644
--- a/merlin/static/merlin/templates/collapsible-panel.html
+++ b/merlin/static/merlin/templates/collapsible-panel.html
@@ -3,9 +3,7 @@
-
- {$ ::panel.title $}
+
diff --git a/merlin/static/merlin/templates/fields/dictionary.html b/merlin/static/merlin/templates/fields/dictionary.html
index 33017ac..858d4dc 100644
--- a/merlin/static/merlin/templates/fields/dictionary.html
+++ b/merlin/static/merlin/templates/fields/dictionary.html
@@ -1,10 +1,7 @@
-
+
-
diff --git a/merlin/static/merlin/templates/fields/frozendict.html b/merlin/static/merlin/templates/fields/frozendict.html
index 97b4c0f..f4c5264 100644
--- a/merlin/static/merlin/templates/fields/frozendict.html
+++ b/merlin/static/merlin/templates/fields/frozendict.html
@@ -2,20 +2,19 @@
-
+
-
+ label="key" for="{$ field.uid() $}">
diff --git a/merlin/static/merlin/templates/labeled.html b/merlin/static/merlin/templates/labeled.html
index f011b06..1920581 100644
--- a/merlin/static/merlin/templates/labeled.html
+++ b/merlin/static/merlin/templates/labeled.html
@@ -1,4 +1,6 @@
diff --git a/merlin/static/merlin/templates/title.html b/merlin/static/merlin/templates/title.html
new file mode 100644
index 0000000..b5740aa
--- /dev/null
+++ b/merlin/static/merlin/templates/title.html
@@ -0,0 +1,3 @@
+
+
{$ ::ngModel $}