cadastro-proposta.directive.js
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(function() {
'use strict';
angular
.module('dialoga')
.directive('cadastroProposta', cadastroProposta);
/** @ngInject */
function cadastroProposta() {
/** @ngInject */
function CadastroPropostaController ($scope, $element, $timeout, $log) {
$log.debug('cadastroPropostaController');
var vm = this;
vm.$scope = $scope;
vm.$element = $element;
vm.$timeout = $timeout;
vm.$log = $log;
vm.init();
}
CadastroPropostaController.prototype.init = function () {
// async values
var vm = this;
// requeue to wait until DOM be created
vm.$timeout(function(){
attachPopover.call(vm);
}, 100);
};
function attachPopover(){
var vm = this;
vm.popover = angular.element(vm.$element.find('.link-popover'));
vm.popover.popover({
html: true,
placement: 'bottom',
animation: true,
title: 'Regra de posição das propostas',
content: '<p>Poderia escrever a sua proposta em um texto simples e breve?</p><br><p>Sua proposta passará pela fase de moderação. Assim que ela estiver pronta para compartilhar, avisaremos você.'
});
}
var directive = {
restrict: 'E',
templateUrl: 'app/components/cadastro-proposta/cadastro-proposta.html',
scope: {},
controller: CadastroPropostaController,
controllerAs: 'vm',
bindToController: true
};
return directive;
}
})();