Built motion from commit 19a84241.|2.5.34
[motion2.git] / server / api / dashboardItem / dashboardItem.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x922c=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x494565,_0x56f5eb){var _0x1a6547=function(_0x1f0b5b){while(--_0x1f0b5b){_0x494565['push'](_0x494565['shift']());}};_0x1a6547(++_0x56f5eb);}(_0x922c,0x92));var _0xc922=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x922c[_0x7dbd65];return _0x33d551;};'use strict';var EventEmitter=require(_0xc922('0x0'));var DashboardItem=require(_0xc922('0x1'))['db'][_0xc922('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc922('0x3'),'afterUpdate':_0xc922('0x4'),'afterDestroy':_0xc922('0x5')};function emitEvent(_0x2f4d02){return function(_0x4f7b8a,_0x2b18d6,_0x5291aa){DashboardItemEvents[_0xc922('0x6')](_0x2f4d02+':'+_0x4f7b8a['id'],_0x4f7b8a);DashboardItemEvents[_0xc922('0x6')](_0x2f4d02,_0x4f7b8a);_0x5291aa(null);};}for(var e in events){if(events[_0xc922('0x7')](e)){var event=events[e];DashboardItem[_0xc922('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;