Run js-beautify and fixjsstyle on code
Found this pointer on stackoverflow:
https://stackoverflow.com/a/31660434/5508494
End goal is to get the code formatted well enough that
clang format will run correctly against it.
Change-Id: I80053e78d253d8eee49233e42d55e5807ae8fdc8
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/app/common/directives/confirm.js b/app/common/directives/confirm.js
index 5bb699a..a542783 100644
--- a/app/common/directives/confirm.js
+++ b/app/common/directives/confirm.js
@@ -1,39 +1,44 @@
-window.angular && (function (angular) {
- 'use strict';
+window.angular && (function(angular) {
+ 'use strict';
- angular
- .module('app.common.directives')
- .directive('confirm', ['$timeout', function($timeout){
- return {
- 'restrict': 'E',
- 'template': require('./confirm.html'),
- 'scope': {
- 'title': '@',
- 'message': '@',
- 'confirm': '=',
- 'callback': '='
- },
- 'controller': ['$scope',function($scope){
- $scope.cancel = function(){
- $scope.confirm = false;
- $scope.$parent.confirm = false;
- };
- $scope.accept = function(){
- $scope.callback();
- $scope.cancel();
- }
- }],
- link: function(scope, e) {
- scope.$watch('confirm', function(){
- if(scope.confirm){
- $timeout(function(){
- angular.element(e[0].parentNode).css({'min-height': e[0].querySelector('.inline__confirm').offsetHeight + 'px'});
- }, 0);
- }else{
- angular.element(e[0].parentNode).css({'min-height': 0+ 'px'});
- }
- });
- }
- };
- }]);
+ angular
+ .module('app.common.directives')
+ .directive('confirm', ['$timeout', function($timeout) {
+ return {
+ 'restrict': 'E',
+ 'template': require('./confirm.html'),
+ 'scope': {
+ 'title': '@',
+ 'message': '@',
+ 'confirm': '=',
+ 'callback': '='
+ },
+ 'controller': ['$scope', function($scope) {
+ $scope.cancel = function() {
+ $scope.confirm = false;
+ $scope.$parent.confirm = false;
+ };
+ $scope.accept = function() {
+ $scope.callback();
+ $scope.cancel();
+ };
+ }],
+ link: function(scope, e) {
+ scope.$watch('confirm', function() {
+ if (scope.confirm) {
+ $timeout(function() {
+ angular.element(e[0].parentNode).css({
+ 'min-height': e[0].querySelector('.inline__confirm').offsetHeight + 'px'
+ });
+ }, 0);
+ }
+ else {
+ angular.element(e[0].parentNode).css({
+ 'min-height': 0 + 'px'
+ });
+ }
+ });
+ }
+ };
+ }]);
})(window.angular);