OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 722a8a9409f3bbe3da0a1c77d709d68cfb0a6705
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
 (function(){
    'use strict';
 
    // Key codes
    var keys = {
        enter : 13,
        esc   : 27,
        left  : 37,
        right : 39
    };
 
    angular
    .module('thatisuday.ng-image-gallery', ['ngAnimate'])
    .provider('ngImageGalleryOpts', function(){
        var defOpts = {
            thumbnails      :   true,
            thumbSize        :     80,
            inline          :   false,
            bubbles         :   true,
            bubbleSize        :     20,
            imgBubbles      :   false,
            bgClose         :   false,
            piracy             :     false,
            imgAnim         :     'fadeup',
            errorPlaceHolder:   'Error when loading the image!'
        };
 
        return{
            setOpts : function(newOpts){
                angular.extend(defOpts, newOpts);
            },
            $get : function(){
                return defOpts;
            }
        }
    })
    .filter('ngImageGalleryTrust', ['$sce', function($sce) {
      return function(value, type) {
        // Defaults to treating trusted value as `html`
        return $sce.trustAs(type || 'html', value);
      }
    }])
    .directive('ngRightClick', ['$parse', function($parse){
        return {
            restrict: "A",
            scope : false,
            link : function(scope, element, attrs){
                element.bind('contextmenu', function(event){
                    if(scope.piracy == false){
                        event.preventDefault();
                        return scope.piracy;
                    }
                });
            }
        };
    }])
    .directive("showImageAsync", [function(){
        return {
            restrict: "A",
            scope: false,
            link: function (scope, element, attributes){
                var image = new Image();
                image.src = attributes.showImageAsync;
                image.onload = function(){
                    scope.$apply(function(){
                        if(attributes.asyncKind == 'thumb'){
                            element.css({ backgroundImage: 'url("' + attributes.showImageAsync + '")' });
                            element.empty(); // remove loading animation element
                        }
                        else if(attributes.asyncKind == 'bubble'){
                            element.css({ backgroundImage: 'url("' + attributes.showImageAsync + '")' });
                        }
                    });
                };
                image.onerror = function(){
                    element.empty(); // remove loading animation element
                }
            }
        };
    }])
    .directive("bubbleAutoFit", ['$window', '$timeout', function($window, $timeout){
        return {
            restrict: "A",
            scope: false,
            link: {
                pre : function (scope, element, attributes){
                    var autoFitBubbles = function(){
                        var scrollerWidth = element[0].getBoundingClientRect().width;
                        if(scrollerWidth == 0) return;
 
                        var bubbleSize = scope.bubbleSize;
                        var minMargin = 4 + 4; // left+right
                        var bubbleSpace = (bubbleSize + minMargin);
                        var rawQuotient = scrollerWidth / bubbleSpace;
                        var bubblesInView = Math.floor(rawQuotient);
                        var extraSpace = scrollerWidth - (bubblesInView * bubbleSpace);
                        var extraMargin = extraSpace / bubblesInView;
                        var bubbleMargin = minMargin + extraMargin;
                        var finalBubbleSpace = bubbleMargin + bubbleSize;
 
                        scope._bubblesInView = bubblesInView;
                        scope._finalBubbleSpace = finalBubbleSpace;
                        scope._bubbleMargin = '0 ' + (bubbleMargin/2) + 'px';
 
                        scope._safeApply(angular.noop);
                    };
 
                    $timeout(autoFitBubbles);
 
                    angular.element($window).bind('resize', function(){
                        $timeout(autoFitBubbles);
                    });
                    scope.$watch('inline', function(){
                        $timeout(autoFitBubbles);
                    });
                    scope.$watch('bubbleSize', function(){
                        $timeout(autoFitBubbles);
                    });
                    scope.$watchCollection('images', function(){
                        $timeout(autoFitBubbles);
                    });
                }
            }
        };
    }])
    .directive("bubbleAutoScroll", ['$window', '$timeout', function($window, $timeout){
        return {
            restrict: "A",
            scope: false,
            link: function (scope, element, attributes){
 
                var indexCalc = function(){
                    var relativeIndexToBubbleWrapper = scope._bubblesInView - (scope._bubblesInView - scope._activeImageIndex);
 
                    $timeout(function(){
                        if(relativeIndexToBubbleWrapper > scope._bubblesInView - 2){
                            var outBubbles = ((scope._activeImageIndex+1) - scope._bubblesInView) + 1;
 
                            if(scope._activeImageIndex != (scope.images.length - 1)){
                                scope._bubblesContainerMarginLeft = '-' + (scope._finalBubbleSpace * outBubbles) + 'px';
                            }
                            else{
                                scope._bubblesContainerMarginLeft = '-' + (scope._finalBubbleSpace * (outBubbles - 1)) + 'px';
                            }
                        }
                        else{
                            scope._bubblesContainerMarginLeft = '0px';
                        }
                    });
                }
 
                angular.element($window).bind('resize', function(){
                    $timeout(indexCalc);
                });
                scope.$watch('_bubblesInView', function(){
                    $timeout(indexCalc);
                });
                scope.$watch('_activeImageIndex', function(){
                    $timeout(indexCalc);
                });
                scope.$watchCollection('images', function(){
                    $timeout(indexCalc);
                });
            }
        };
    }])
    .directive('ngImageGallery', ['$rootScope', '$timeout', '$q', 'ngImageGalleryOpts',
    function($rootScope, $timeout, $q, ngImageGalleryOpts){
        return {
            replace : true,
            transclude : false,
            restrict : 'AE',
            scope : {
                images             :     '=',        // []
                methods         :     '=?',        // {}
                conf             :     '=?',        // {}
 
                thumbnails         :     '=?',        // true|false
                thumbSize        :     '=?',         // px
                inline             :     '=?',        // true|false
                bubbles         :     '=?',        // true|false
                bubbleSize         :     '=?',        // px
                imgBubbles         :     '=?',        // true|false
                bgClose         :     '=?',        // true|false
                piracy            :     '=?',        // true|false
                imgAnim         :     '@?',        // {name}
                errorPlaceHolder:     '@?',        // {name}
 
                onOpen             :     '&?',        // function
                onClose         :     '&?',        // function,
                onDelete        :     '&?'
            },
            template :     '<div class="ng-image-gallery img-move-dir-{{_imgMoveDirection}}" ng-class="{inline:inline}" ng-hide="images.length == 0">'+
 
                            // Thumbnails container
                            //  Hide for inline gallery
                            '<div ng-if="thumbnails && !inline" class="ng-image-gallery-thumbnails">' +
                                 '<div class="thumb" ng-repeat="image in images track by image.id" ng-click="methods.open($index);" show-image-async="{{image.thumbUrl || image.url}}" async-kind="thumb" ng-style="{\'width\' : thumbSize+\'px\', \'height\' : thumbSize+\'px\'}">'+
                                     '<div class="loader"></div>'+
                                 '</div>' +
                             '</div>' +
 
                            // Modal container
                            // (inline container for inline modal)
                            '<div class="ng-image-gallery-modal" ng-if="opened" ng-cloak>' +
 
                                // Gallery backdrop container
                                // (hide for inline gallery)
                                '<div class="ng-image-gallery-backdrop" ng-if="!inline"></div>'+
 
                                // Gallery contents container
                                // (hide when image is loading)
                                '<div class="ng-image-gallery-content" ng-show="!imgLoading" ng-click="backgroundClose($event);">'+
 
                                    // actions icons container
                                    '<div class="actions-icons-container">'+
                                        // Delete image icon
                                        '<div class="delete-img" ng-repeat="image in images track by image.id" ng-if="_activeImg == image && image.deletable" title="Delete this image..." ng-click="_deleteImg(image)"></div>'+
                                    '</div>'+
 
                                    // control icons container
                                    '<div class="control-icons-container">'+
                                        // External link icon
                                        '<a class="ext-url" ng-repeat="image in images track by image.id" ng-if="_activeImg == image && image.extUrl" href="{{image.extUrl}}" target="_blank" title="Open image in new tab..."></a>'+
 
                                        // Close Icon (hidden in inline gallery)
                                        '<div class="close" ng-click="methods.close();" ng-if="!inline"></div>'+
                                    '</div>'+
 
                                    // Prev-Next Icons
                                    // Add `bubbles-on` class when bubbles are enabled (for offset)
                                    '<div class="prev" ng-click="methods.prev();" ng-class="{\'bubbles-on\':bubbles}" ng-hide="images.length == 1"></div>'+
                                    '<div class="next" ng-click="methods.next();" ng-class="{\'bubbles-on\':bubbles}" ng-hide="images.length == 1"></div>'+
 
                                    // Galleria container
                                    '<div class="galleria">'+
 
                                        // Images container
                                        '<div class="galleria-images img-anim-{{imgAnim}} img-move-dir-{{_imgMoveDirection}}">'+
                                            '<img class="galleria-image" ng-right-click ng-repeat="image in images track by image.id" ng-if="_activeImg == image" ng-src="{{image.url}}" ondragstart="return false;" ng-attr-alt="{{image.alt || undefined}}"/>'+
                                        '</div>'+
 
                                        // Image description container
                                        '<div class="galleria-title-description-wrapper">'+
                                            '<div ng-repeat="image in images track by image.id" ng-if="(image.title || image.desc) && (_activeImg == image)">'+
                                                '<div class="title" ng-if="image.title" ng-bind-html="image.title | ngImageGalleryTrust"></div>'+
                                                '<div class="desc" ng-if="image.desc" ng-bind-html="image.desc | ngImageGalleryTrust"></div>'+
                                            '</div>'+
                                        '</div>'+
 
                                        // Bubble navigation container
                                        '<div class="galleria-bubbles-wrapper" ng-if="bubbles && !imgBubbles" ng-hide="images.length == 1" ng-style="{\'height\' : bubbleSize+\'px\'}" bubble-auto-fit>'+
                                            '<div class="galleria-bubbles" bubble-auto-scroll ng-style="{\'margin-left\': _bubblesContainerMarginLeft}">'+
                                                '<span class="galleria-bubble" ng-click="_setActiveImg(image);" ng-repeat="image in images track by image.id" ng-class="{active : (_activeImg == image)}" ng-style="{\'width\' : bubbleSize+\'px\', \'height\' : bubbleSize+\'px\', margin: _bubbleMargin}"></span>'+
                                            '</div>'+
                                        '</div>'+
 
                                        // Image bubble navigation container
                                        '<div class="galleria-bubbles-wrapper" ng-if="bubbles && imgBubbles" ng-hide="images.length == 1" ng-style="{\'height\' : bubbleSize+\'px\'}" bubble-auto-fit>'+
                                            '<div class="galleria-bubbles" bubble-auto-scroll ng-style="{\'margin-left\': _bubblesContainerMarginLeft}">'+
                                                '<span class="galleria-bubble img-bubble" ng-click="_setActiveImg(image);" ng-repeat="image in images track by image.id" ng-class="{active : (_activeImg == image)}" show-image-async="{{image.bubbleUrl || image.thumbUrl || image.url}}" async-kind="bubble" ng-style="{\'width\' : bubbleSize+\'px\', \'height\' : bubbleSize+\'px\', \'border-width\' : bubbleSize/10+\'px\', margin: _bubbleMargin}"></span>'+
                                            '</div>'+
                                        '</div>'+
 
                                    '</div>'+
 
                                '</div>'+
 
                                // Loading animation overlay container
                                // (show when image is loading)
                                '<div class="ng-image-gallery-loader" ng-show="imgLoading">'+
                                    '<div class="spinner">'+
                                        '<div class="rect1"></div>'+
                                        '<div class="rect2"></div>'+
                                        '<div class="rect3"></div>'+
                                        '<div class="rect4"></div>'+
                                        '<div class="rect5"></div>'+
                                    '</div>'+
                                '</div>'+
 
                                // (show when image cannot be loaded)
                                '<div class="ng-image-gallery-errorplaceholder" ng-show="imgError">'+
                                    '<div class="ng-image-gallery-error-placeholder" ng-bind-html="errorPlaceHolder | ngImageGalleryTrust"></div>'+
                                '</div>'+
                            '</div>'+
                        '</div>',
 
            link : {
                pre : function(scope, elem, attr){
 
                    /*
                     *    Operational functions
                    **/
 
                    // Show gallery loader
                    scope._showLoader = function(){
                        scope.imgLoading = true;
                    }
 
                    // Hide gallery loader
                    scope._hideLoader = function(){
                        scope.imgLoading = false;
                    }
 
                    // Image load complete promise
                    scope._loadImg = function(imgObj){
 
                        // Return rejected promise
                        // if not image object received
                        if(!imgObj) return $q.reject();
 
                        var deferred =  $q.defer();
 
                        // Show loder
                        if(!imgObj.hasOwnProperty('cached')) scope._showLoader();
 
                        // Process image
                        var img = new Image();
                        img.src = imgObj.url;
                        img.onload = function(){
                            // Hide loder
                            if(!imgObj.hasOwnProperty('cached')) scope._hideLoader();
 
                            // Cache image
                            if(!imgObj.hasOwnProperty('cached')) imgObj.cached = true;
 
                            deferred.resolve(imgObj);
                        }
                        img.onerror = function(){
                            if(!imgObj.hasOwnProperty('cached')) scope._hideLoader();
 
                            deferred.reject('Error when loading img');
                        }
 
                        return deferred.promise;
                    }
 
                    scope._setActiveImg = function(imgObj){
                        // Get images move direction
                        if(
                            scope.images.indexOf(scope._activeImg) - scope.images.indexOf(imgObj) == (scope.images.length - 1) ||
                            (
                                scope.images.indexOf(scope._activeImg) - scope.images.indexOf(imgObj) <= 0 &&
                                scope.images.indexOf(scope._activeImg) - scope.images.indexOf(imgObj) != -(scope.images.length - 1)
                            )
 
                        ){
                            scope._imgMoveDirection = 'forward';
                        }
                        else{
                            scope._imgMoveDirection = 'backward';
                        }
 
                        // Load image
                        scope._loadImg(imgObj).then(function(imgObj){
                            scope._activeImg = imgObj;
                            scope._activeImageIndex = scope.images.indexOf(imgObj);
                            scope.imgError = false;
                        }, function(){
                            scope._activeImg = null;
                            scope._activeImageIndex = scope.images.indexOf(imgObj);
                            scope.imgError = true;
                        })
                        ;
                    }
 
                    scope._safeApply = function(fn){
                        var phase = this.$root.$$phase;
                        if(phase == '$apply' || phase == '$digest'){
                            if(fn && (typeof(fn) === 'function')){
                                fn();
                            }
                        }else{
                            this.$apply(fn);
                        }
                    };
 
                    scope._deleteImg = function(img){
                        var _deleteImgCallback = function(){
                            var index = scope.images.indexOf(img);
                            console.log(index);
                            scope.images.splice(index, 1);
                            scope._activeImageIndex = 0;
 
                            /**/
                        }
 
                        scope.onDelete({img: img, cb: _deleteImgCallback});
                    }
 
 
                    /***************************************************/
 
 
                    /*
                     *    Gallery settings
                    **/
 
                    // Modify scope models
                    scope.images           =     (scope.images         != undefined) ? scope.images      :     [];
                    scope.methods           =     (scope.methods         != undefined) ? scope.methods      :     {};
                    scope.conf               =     (scope.conf         != undefined) ? scope.conf          :     {};
 
                    // setting options
                    scope.$watchCollection('conf', function(conf){
                        scope.thumbnails      =     (conf.thumbnails     != undefined) ? conf.thumbnails     :     (scope.thumbnails     != undefined)     ?  scope.thumbnails        :     ngImageGalleryOpts.thumbnails;
                        scope.thumbSize      =     (conf.thumbSize     != undefined) ? conf.thumbSize         :     (scope.thumbSize     != undefined)     ?  scope.thumbSize        :     ngImageGalleryOpts.thumbSize;
                        scope.inline           =     (conf.inline         != undefined) ? conf.inline          :     (scope.inline         != undefined)     ?  scope.inline            :     ngImageGalleryOpts.inline;
                        scope.bubbles           =     (conf.bubbles         != undefined) ? conf.bubbles          :     (scope.bubbles         != undefined)     ?  scope.bubbles        :     ngImageGalleryOpts.bubbles;
                        scope.bubbleSize      =     (conf.bubbleSize     != undefined) ? conf.bubbleSize      :     (scope.bubbleSize     != undefined)     ?  scope.bubbleSize        :     ngImageGalleryOpts.bubbleSize;
                        scope.imgBubbles      =     (conf.imgBubbles     != undefined) ? conf.imgBubbles     :     (scope.imgBubbles     != undefined)     ?  scope.imgBubbles        :     ngImageGalleryOpts.imgBubbles;
                        scope.bgClose           =     (conf.bgClose         != undefined) ? conf.bgClose          :     (scope.bgClose         != undefined)     ?  scope.bgClose        :     ngImageGalleryOpts.bgClose;
                        scope.piracy           =     (conf.piracy         != undefined) ? conf.piracy          :     (scope.piracy         != undefined)     ?  scope.piracy            :     ngImageGalleryOpts.piracy;
                        scope.imgAnim           =     (conf.imgAnim         != undefined) ? conf.imgAnim          :     (scope.imgAnim         != undefined)     ?  scope.imgAnim        :     ngImageGalleryOpts.imgAnim;
                        scope.errorPlaceHolder = (conf.errorPlaceHolder != undefined) ? conf.errorPlaceHolder : (scope.errorPlaceHolder != undefined) ? scope.errorPlaceHolder : ngImageGalleryOpts.errorPlaceHolder;
                    });
 
                    scope.onOpen      =     (scope.onOpen     != undefined) ? scope.onOpen      :     angular.noop;
                    scope.onClose      =     (scope.onClose     != undefined) ? scope.onClose      :     angular.noop;
                    scope.onDelete      =     (scope.onDelete != undefined) ? scope.onDelete      :     angular.noop;
 
                    // If images populate dynamically, reset gallery
                    var imagesFirstWatch = true;
                    scope.$watchCollection('images', function(){
                        if(imagesFirstWatch){
                            imagesFirstWatch = false;
                        }
                        else if(scope.images.length){
                            scope._setActiveImg(scope.images[scope._activeImageIndex || 0]);
                        }
                    });
 
                    // Watch index of visible/active image
                    // If index changes, make sure to load/change image
                    var activeImageIndexFirstWatch = true;
                    scope.$watch('_activeImageIndex', function(newImgIndex){
                        if(activeImageIndexFirstWatch){
                            activeImageIndexFirstWatch = false;
                        }
                        else if(scope.images.length){
                            scope._setActiveImg(
                                scope.images[newImgIndex]
                            );
                        }
                    });
 
                    // Open modal automatically if inline
                    scope.$watch('inline', function(){
                        $timeout(function(){
                            if(scope.inline) scope.methods.open();
                        });
                    });
 
 
                    /***************************************************/
 
 
                    /*
                     *    Methods
                    **/
 
                    // Open gallery modal
                    scope.methods.open = function(imgIndex){
                        // Open modal from an index if one passed
                        scope._activeImageIndex = (imgIndex) ? imgIndex : 0;
 
                        scope.opened = true;
 
                        // set overflow hidden to body
                        if(!scope.inline) angular.element(document.body).addClass('body-overflow-hidden');
 
                        // call open event after transition
                        $timeout(function(){
                            scope.onOpen();
                        }, 300);
                    }
 
                    // Close gallery modal
                    scope.methods.close = function(){
                        scope.opened = false; // Model closed
 
                        // set overflow hidden to body
                        angular.element(document.body).removeClass('body-overflow-hidden');
 
                        // call close event after transition
                        $timeout(function(){
                            scope.onClose();
                            scope._activeImageIndex = 0; // Reset index
                        }, 300);
                    }
 
                    // Change image to next
                    scope.methods.next = function(){
                        if(scope._activeImageIndex == (scope.images.length - 1)){
                            scope._activeImageIndex = 0;
                        }
                        else{
                            scope._activeImageIndex = scope._activeImageIndex + 1;
                        }
                    }
 
                    // Change image to prev
                    scope.methods.prev = function(){
                        if(scope._activeImageIndex == 0){
                            scope._activeImageIndex = scope.images.length - 1;
                        }
                        else{
                            scope._activeImageIndex--;
                        }
                    }
 
                    // Close gallery on background click
                    scope.backgroundClose = function(e){
                        if(!scope.bgClose || scope.inline) return;
 
                        var noCloseClasses = [
                            'galleria-image',
                            'destroy-icons-container',
                            'ext-url',
                            'close',
                            'next',
                            'prev',
                            'galleria-bubble'
                        ];
 
                        // check if clicked element has a class that
                        // belongs to `noCloseClasses`
                        for(var i = 0; i < e.target.classList.length; i++){
                            if(noCloseClasses.indexOf(e.target.classList[i]) != -1){
                                break;
                            }
                            else{
                                scope.methods.close();
                            }
                        }
                    }
 
 
                    /***************************************************/
 
 
                    /*
                     *    User interactions
                    **/
 
                    // Key events
                    angular.element(document).bind('keyup', function(event){
                        // If inline modal, do not interact
                        if(scope.inline) return;
 
                        if(event.which == keys.right || event.which == keys.enter){
                            $timeout(function(){
                                scope.methods.next();
                            });
                        }
                        else if(event.which == keys.left){
                            $timeout(function(){
                                scope.methods.prev();
                            });
                        }
                        else if(event.which == keys.esc){
                            $timeout(function(){
                                scope.methods.close();
                            });
                        }
                    });
 
                    // Swipe events
                    if(window.Hammer){
                        var hammerElem = new Hammer(elem[0]);
                        hammerElem.on('swiperight', function(ev){
                            $timeout(function(){
                                scope.methods.prev();
                            });
                        });
                        hammerElem.on('swipeleft', function(ev){
                            $timeout(function(){
                                scope.methods.next();
                            });
                        });
                        hammerElem.on('doubletap', function(ev){
                            if(scope.inline) return;
 
                            $timeout(function(){
                                scope.methods.close();
                            });
                        });
                    };
 
 
                    /***********************************************************/
 
 
                    /*
                     *    Actions on angular events
                    **/
 
                    var removeClassFromDocumentBody = function(){
                        angular.element(document.body).removeClass('body-overflow-hidden');
                    };
 
                    $rootScope.$on('$stateChangeSuccess', removeClassFromDocumentBody);
                    $rootScope.$on('$routeChangeSuccess', removeClassFromDocumentBody);
 
                }
            }
        }
    }]);
 })();