Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#123 OK and submit on the properties dialog now update the diagram
  • Loading branch information
jstrachan committed May 23, 2013
1 parent 02a84da commit d48ac0c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
5 changes: 2 additions & 3 deletions hawtio-web/src/main/webapp/app/wiki/html/camelCanvas.html
Expand Up @@ -123,11 +123,10 @@
<form class="form-horizontal no-bottom-margin" ng-submit="updatePropertiesAndCloseDialog()">
<div class="modal-header"><h4>Properties</h4></div>
<div class="modal-body">
<div simple-form name="formEditor" entity='nodeData' data='nodeModel' schema="schema"></div>
<div simple-form name="formEditor" entity='nodeData' data='nodeModel' schema="schema" onsubmit="updatePropertiesAndCloseDialog"></div>
</div>
<div class="modal-footer">
<input class="btn btn-primary add" type="submit" ng-disabled="!selectedPaletteNode"
value="OK">
<input class="btn btn-primary add" type="submit" ng-click="updatePropertiesAndCloseDialog()" value="OK">
<button class="btn btn-warning cancel" type="button" ng-click="propertiesDialog.close()">Cancel</button>
</div>
</form>
Expand Down
3 changes: 2 additions & 1 deletion hawtio-web/src/main/webapp/app/wiki/js/camel.ts
Expand Up @@ -70,6 +70,8 @@ module Wiki {
}
});

$scope.$on("hawtio.form.modelChange", onModelChangeEvent);

$scope.onRootTreeNode = (rootTreeNode) => {
$scope.rootTreeNode = rootTreeNode;
// restore the real data at the root for saving the doc etc
Expand Down Expand Up @@ -238,7 +240,6 @@ module Wiki {
}
};

$scope.$on("hawtio.form.modelChange", onModelChangeEvent);

updateView();

Expand Down
23 changes: 23 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/camelCanvas.ts
Expand Up @@ -44,6 +44,28 @@ module Wiki {
onRouteSelectionChanged();
};

$scope.updatePropertiesAndCloseDialog = () => {
var selectedFolder = $scope.selectedFolder;
if (selectedFolder) {
var routeXmlNode = selectedFolder["routeXmlNode"];
if (routeXmlNode) {
var nodeName = routeXmlNode.localName;
var nodeSettings = Camel.getCamelSchema(nodeName);
if (nodeSettings) {
// update the title and tooltip etc
Camel.updateRouteNodeLabelAndTooltip(selectedFolder, routeXmlNode, nodeSettings);
// TODO update the div directly rather than a full layout?
}
}
// TODO not sure we need this to be honest
selectedFolder["camelNodeData"] = $scope.nodeData;
}
$scope.propertiesDialog.close();
Core.$apply($scope);
treeModified();
};


$scope.$watch("selectedRouteId", onRouteSelectionChanged);

function addNewNode(nodeModel) {
Expand Down Expand Up @@ -99,6 +121,7 @@ module Wiki {
$scope.doc = Core.pathGet(tree, ["xmlDocument"]);
}
$scope.doLayout();
Core.$apply($scope);
}


Expand Down

0 comments on commit d48ac0c

Please sign in to comment.