From 0ea2682661617cf2827117bcfaa8997a8e39cd90 Mon Sep 17 00:00:00 2001 From: Warren Date: Tue, 4 Sep 2018 11:34:10 +0100 Subject: [PATCH] Adds in new util directive isolate-form used for nested forms that you do not want dirty to propogate upwards to parent forms --- .../common/directives/util/isolateform.directive.js | 10 ++++++++++ .../src/views/components/upload/umb-file-dropzone.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Web.UI.Client/src/common/directives/util/isolateform.directive.js diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/util/isolateform.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/util/isolateform.directive.js new file mode 100644 index 0000000000..62aa772fb3 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/directives/util/isolateform.directive.js @@ -0,0 +1,10 @@ +angular.module("umbraco.directives") + .directive('isolateForm', function ($window, $timeout, windowResizeListener) { + return { + restrict: 'A', + require: ['form', '^form'], + link: function(scope, element, attrs, forms) { + forms[1].$removeControl(forms[0]); + } + } + }); diff --git a/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html b/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html index 03d1a84908..f38a66ef29 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-file-dropzone.html @@ -1,6 +1,6 @@
- +