Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Commit

Permalink
Adds custom directive, so to handle the "formSubmitting" event sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
leekelleher committed Jun 13, 2018
1 parent 4710775 commit 16be3d9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@

var unsubscribe = $scope.$on("formSubmitting", function (ev, args) {

$scope.$broadcast("propertyListFormSubmitting");

var tmpValue = {
dtd: dataTypeGuid,
values: []
Expand Down Expand Up @@ -243,6 +245,33 @@ angular.module("umbraco").controller("Our.Umbraco.PropertyList.Controllers.DataT

}]);

angular.module("umbraco.directives").directive("propertyListPropertyEditor", [
function () {

var link = function ($scope, $element, $attrs, $ctrl) {

var unsubscribe = $scope.$on("propertyListFormSubmitting", function (ev, args) {
$scope.$broadcast("formSubmitting", { scope: $scope });
});

$scope.$on("$destroy", function () {
unsubscribe();
});
};

return {
require: "^form",
restrict: "E",
rep1ace: true,
link: link,
template: '<umb-property-editor model="control" />',
scope: {
control: "=model"
}
};
}
]);

angular.module("umbraco.resources").factory("Our.Umbraco.PropertyList.Resources.PropertyListResources", [
"$http",
"umbRequestHelper",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<i class="icon-navigation list-view-layout__sort-handle"></i>

<div class="list-view-layout__path">
<umb-property-editor model="control" />
<property-list-property-editor model="control" />
</div>

<div ng-if="vm.canDelete()" class="list-view-layout__remove">
Expand Down

0 comments on commit 16be3d9

Please sign in to comment.