diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/crm/wp-content/plugins/civicrm/civicrm/ang/crmStatusPage/StatusPageServices.js |
first commit
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/ang/crmStatusPage/StatusPageServices.js')
-rw-r--r-- | www/crm/wp-content/plugins/civicrm/civicrm/ang/crmStatusPage/StatusPageServices.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmStatusPage/StatusPageServices.js b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmStatusPage/StatusPageServices.js new file mode 100644 index 00000000..a37ceafb --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmStatusPage/StatusPageServices.js @@ -0,0 +1,31 @@ +(function(angular, $, _) { + + angular.module('statuspage') + .filter('trusted', function($sce){ return $sce.trustAsHtml; }) + + // Todo: abstract this into a generic crmUi directive? + .directive('statuspagePopupMenu', function($timeout) { + return { + templateUrl: '~/statuspage/SnoozeOptions.html', + transclude: true, + + link: function(scope, element, attr) { + element.on('click', '.hush-menu-button', function() { + $timeout(function() { + $('ul', element).show().menu(); + element.closest('h3').addClass('menuopen'); + $('body').one('click', function() { + $('ul', element).menu('destroy').hide(); + element.closest('h3').removeClass('menuopen'); + }); + }); + }); + // TODO: Is there a more "Angular" way to do this animation? + element.on('click', 'button:not(.hush-menu-button), li', function() { + $(this).closest('div.crm-status-item').slideUp(); + }); + } + }; + }); + +})(angular, CRM.$, CRM._); |