modules/notification/js/notification_service.js
function buildDialogActions(_buttons, _callback, _unbind)
        {
            var $compile = $injector.get('$compile');

            var dialogActions = angular.element('<div/>',
            {
                class: 'dialog__footer'
            });

            var dialogLastBtn = angular.element('<button/>',
            {
                class: 'btn btn--m btn--blue btn--flat',
                text: _buttons.ok
            });

            if (angular.isDefined(_buttons.cancel))
            {
                var dialogFirstBtn = angular.element('<button/>',
                {
                    class: 'btn btn--m btn--red btn--flat',
                    text: _buttons.cancel
                });

                dialogFirstBtn.attr('lx-ripple', '');
                $compile(dialogFirstBtn)($rootScope);

                dialogActions.append(dialogFirstBtn);

                dialogFirstBtn.bind('click', function()
                {
                    _callback(false);
                    closeDialog();
                });
            }

            dialogLastBtn.attr('lx-ripple', '');
            $compile(dialogLastBtn)($rootScope);

            dialogActions.append(dialogLastBtn);

            dialogLastBtn.bind('click', function()
            {
                _callback(true);
                closeDialog();
            });

            if (!_unbind)
            {
                idEventScheduler = LxEventSchedulerService.register('keyup', function(event)
                {
                    if (event.keyCode == 13)
                    {
                        _callback(true);
                        closeDialog();
                    }
                    else if (event.keyCode == 27)
                    {
                        _callback(angular.isUndefined(_buttons.cancel));
                        closeDialog();
                    }

                    event.stopPropagation();
                });
            }

            return dialogActions;
        }
function buildDialogActions(_buttons, _callback, _unbind)
        {
            var $compile = $injector.get('$compile');

            var dialogActions = angular.element('<div/>',
            {
                class: 'dialog__footer'
            });

            var dialogLastBtn = angular.element('<button/>',
            {
                class: 'btn btn--m btn--blue btn--flat',
                text: _buttons.ok
            });

            if (angular.isDefined(_buttons.cancel))
            {
                var dialogFirstBtn = angular.element('<button/>',
                {
                    class: 'btn btn--m btn--red btn--flat',
                    text: _buttons.cancel
                });

                dialogFirstBtn.attr('lx-ripple', '');
                $compile(dialogFirstBtn)($rootScope);

                dialogActions.append(dialogFirstBtn);

                dialogFirstBtn.bind('click', function()
                {
                    _callback(false);
                    closeDialog();
                });
            }

            dialogLastBtn.attr('lx-ripple', '');
            $compile(dialogLastBtn)($rootScope);

            dialogActions.append(dialogLastBtn);

            dialogLastBtn.bind('click', function()
            {
                _callback(true);
                closeDialog();
            });

            if (!_unbind)
            {
                idEventScheduler = LxEventSchedulerService.register('keyup', function(event)
                {
                    if (event.keyCode == 13)
                    {
                        _callback(true);
                        closeDialog();
                    }
                    else if (event.keyCode == 27)
                    {
                        _callback(angular.isUndefined(_buttons.cancel));
                        closeDialog();
                    }

                    event.stopPropagation();
                });
            }

            return dialogActions;
        }
function buildDialogActions ( _buttons , _callback , _unbind ) { var $compile = $injector . get ( '$compile' ) ; var dialogActions = angular . element ( '<div/>' , { class : 'dialog__footer' } ) ; var dialogLastBtn = angular . element ( '<button/>' , { class : 'btn btn--m btn--blue btn--flat' , text : _buttons . ok } ) ; if ( angular . isDefined ( _buttons . cancel ) ) { var dialogFirstBtn = angular . element ( '<button/>' , { class : 'btn btn--m btn--red btn--flat' , text : _buttons . cancel } ) ; dialogFirstBtn . attr ( 'lx-ripple' , '' ) ; $compile ( dialogFirstBtn ) ( $rootScope ) ; dialogActions . append ( dialogFirstBtn ) ; dialogFirstBtn . bind ( 'click' , function ( ) { _callback ( false ) ; closeDialog ( ) ; } ) ; } dialogLastBtn . attr ( 'lx-ripple' , '' ) ; $compile ( dialogLastBtn ) ( $rootScope ) ; dialogActions . append ( dialogLastBtn ) ; dialogLastBtn . bind ( 'click' , function ( ) { _callback ( true ) ; closeDialog ( ) ; } ) ; if ( ! _unbind ) { idEventScheduler = LxEventSchedulerService . register ( 'keyup' , function ( event ) { if ( event . keyCode == 13 ) { _callback ( true ) ; closeDialog ( ) ; } else if ( event . keyCode == 27 ) { _callback ( angular . isUndefined ( _buttons . cancel ) ) ; closeDialog ( ) ; } event . stopPropagation ( ) ; } ) ; } return dialogActions ; }
ALERT & CONFIRM
ALERT & CONFIRM