From 207819eca9f8ab6932ce9694043b8dc7c8d97801 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 19 Mar 2015 13:29:11 -0400 Subject: [PATCH] CRM-15706 - Refactor Angular uiAccordions and add help --- js/angular-crm-ui.js | 16 ++++++++++++---- js/angular-crmMailing.js | 3 ++- partials/crmMailing/edit-unified.html | 4 ++-- partials/crmMailing/edit-unified2.html | 18 +++++++++--------- partials/crmMailing/edit-wizard.html | 20 ++++++++++---------- partials/crmMailing/edit-workflow.html | 22 +++++++++++----------- partials/crmMailing/edit.html | 10 +++++----- partials/crmMailingAB/edit.html | 20 ++++++++++---------- partials/crmMailingAB/list.html | 2 +- 9 files changed, 62 insertions(+), 53 deletions(-) diff --git a/js/angular-crm-ui.js b/js/angular-crm-ui.js index c97a861444..f055ca6c7d 100644 --- a/js/angular-crm-ui.js +++ b/js/angular-crm-ui.js @@ -10,15 +10,23 @@ .directive('crmUiAccordion', function() { return { scope: { - crmTitle: '@', - crmCollapsed: '@' + crmUiAccordion: '=' }, - template: '
{{$parent.$eval(crmTitle)}}
', + template: '
{{crmUiAccordion.title}}
', transclude: true, link: function (scope, element, attrs) { scope.cssClasses = { - collapsed: scope.$parent.$eval(attrs.crmCollapsed) + 'crm-accordion-wrapper': true, + collapsed: scope.crmUiAccordion.collapsed }; + scope.help = null; + scope.$watch('crmUiAccordion', function(crmUiAccordion) { + if (crmUiAccordion && crmUiAccordion.help) { + scope.help = crmUiAccordion.help.clone({}, { + title: crmUiAccordion.title + }); + } + }); } }; }) diff --git a/js/angular-crmMailing.js b/js/angular-crmMailing.js index b111c3969a..0404547a5e 100644 --- a/js/angular-crmMailing.js +++ b/js/angular-crmMailing.js @@ -72,13 +72,14 @@ $location.replace(); }); - angular.module('crmMailing').controller('EditMailingCtrl', function EditMailingCtrl($scope, selectedMail, $location, crmMailingMgr, crmStatus, attachments, crmMailingPreviewMgr, crmBlocker, CrmAutosaveCtrl, $timeout) { + angular.module('crmMailing').controller('EditMailingCtrl', function EditMailingCtrl($scope, selectedMail, $location, crmMailingMgr, crmStatus, attachments, crmMailingPreviewMgr, crmBlocker, CrmAutosaveCtrl, $timeout, crmUiHelp) { $scope.mailing = selectedMail; $scope.attachments = attachments; $scope.crmMailingConst = CRM.crmMailing; $scope.checkPerm = CRM.checkPerm; var ts = $scope.ts = CRM.ts(null); + $scope.hs = crmUiHelp({file: 'CRM/Mailing/MailingUI'}); var block = $scope.block = crmBlocker(); var myAutosave = null; diff --git a/partials/crmMailing/edit-unified.html b/partials/crmMailing/edit-unified.html index 35854109ef..2e634ffe6e 100644 --- a/partials/crmMailing/edit-unified.html +++ b/partials/crmMailing/edit-unified.html @@ -35,11 +35,11 @@ -
+
-
+
diff --git a/partials/crmMailing/edit-unified2.html b/partials/crmMailing/edit-unified2.html index cc20ff2afb..8d3ec0fe0a 100644 --- a/partials/crmMailing/edit-unified2.html +++ b/partials/crmMailing/edit-unified2.html @@ -10,32 +10,32 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/partials/crmMailing/edit-wizard.html b/partials/crmMailing/edit-wizard.html index 4337c859f1..f8b4fa3001 100644 --- a/partials/crmMailing/edit-wizard.html +++ b/partials/crmMailing/edit-wizard.html @@ -12,42 +12,42 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/partials/crmMailing/edit-workflow.html b/partials/crmMailing/edit-workflow.html index cd530abb80..bbc2a82031 100644 --- a/partials/crmMailing/edit-workflow.html +++ b/partials/crmMailing/edit-workflow.html @@ -12,44 +12,44 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/partials/crmMailing/edit.html b/partials/crmMailing/edit.html index b46a54ca28..b799f7d04d 100644 --- a/partials/crmMailing/edit.html +++ b/partials/crmMailing/edit.html @@ -13,10 +13,10 @@
-
+
-
+
@@ -37,15 +37,15 @@
-
+
-
+
-
+
diff --git a/partials/crmMailingAB/edit.html b/partials/crmMailingAB/edit.html index 75a7c5ea56..e50d798c0a 100644 --- a/partials/crmMailingAB/edit.html +++ b/partials/crmMailingAB/edit.html @@ -49,10 +49,10 @@ subjectB: 1 }" crm-abtest="abtest">
-
+
-
+
@@ -73,10 +73,10 @@
-
+
-
+
@@ -91,10 +91,10 @@ subjectA: 1 }" crm-abtest="abtest">
-
+
-
+
@@ -111,7 +111,7 @@
-
+
@@ -126,10 +126,10 @@ subjectB: 1 }" crm-abtest="abtest">
-
+
-
+
@@ -146,7 +146,7 @@
-
+
diff --git a/partials/crmMailingAB/list.html b/partials/crmMailingAB/list.html index 361f9c867c..1944350ecb 100644 --- a/partials/crmMailingAB/list.html +++ b/partials/crmMailingAB/list.html @@ -5,7 +5,7 @@ Required vars: mailingABList -
+
-- 2.25.1