Tarea #315 dialog refactor needed CR JUAN

This commit is contained in:
gerard 2018-05-30 08:45:02 +02:00
parent c6a8b4cea9
commit fc67fdd6af
1 changed files with 5 additions and 5 deletions

View File

@ -9,18 +9,18 @@ import './style.scss';
* @property {HTMLElement} buttons The dialog HTML buttons * @property {HTMLElement} buttons The dialog HTML buttons
*/ */
export default class Dialog extends Component { export default class Dialog extends Component {
constructor($element, $transclude) { constructor($element, $scope, $transclude) {
super($element); super($element, $scope);
this.shown = false; this.shown = false;
this.$element.addClass('vn-dialog'); this.$element.addClass('vn-dialog');
this.element.addEventListener('mousedown', this.element.addEventListener('mousedown',
e => this.onBackgroundMouseDown(e)); e => this.onBackgroundMouseDown(e));
if ($transclude) { if ($transclude) {
$transclude(tClone => { $transclude($scope.$parent, tClone => {
this.body = tClone[0]; this.body = tClone[0];
}, null, 'body'); }, null, 'body');
$transclude(tClone => { $transclude($scope.$parent, tClone => {
this.buttons = tClone[0]; this.buttons = tClone[0];
}, null, 'buttons'); }, null, 'buttons');
} }
@ -104,7 +104,7 @@ export default class Dialog extends Component {
clearTimeout(this.transitionTimeout); clearTimeout(this.transitionTimeout);
} }
} }
Dialog.$inject = ['$element', '$transclude']; Dialog.$inject = ['$element', '$scope', '$transclude'];
ngModule.component('vnDialog', { ngModule.component('vnDialog', {
template: require('./dialog.html'), template: require('./dialog.html'),