{"version":3,"sources":["Honeywell.ClientModel.EventsController.ts"],"names":["initializeEventsShowLongDescription","$","click","e","preventDefault","this","closest","find","slideToggle","EventsController","prototype","loadInfo","renderEventsList","items","totalItemCount","length","show","each","index","RedirectURL","undefined","TrainingEvent","TrainingUrl","data","Items","userTerms","Honeywell_ClientModel_MainHelper_1","MainHelper","userLanguageTerms","Honeywell_ClientModel_TemplateService_1","TemplateService","getTemplate","then","template","document","getElementById","innerHTML","pc","Honeywell_Clientmodel_PaginationController_1","PaginationController","loadPagination","handleError","reason","html","exports","on"],"mappings":"2LA6DA,SAAgBA,KACZC,EAAE,0BAA0BC,MAAM,SAAUC,GACxCA,EAAEC,iBACiBH,EAAEI,MAAMC,QAAQ,iBAAiBC,KAAK,kBAC5CC,gEAzDrB,IAEAC,GAAA,WAAA,QAAAA,MA4CA,MA1CIA,GAAAC,UAAAC,SAAA,aAIAF,EAAAC,UAAAE,iBAAA,SAAiBC,EAAcC,GAEvBD,EAAME,OAAS,IACfd,EAAE,oBAAoBe,OACtBf,EAAEY,GAAOI,KAAK,SAAUC,GACc,KAA7BL,EAAMK,GAAOC,iBAAmDC,KAA7BP,EAAMK,GAAOC,aAA0D,OAA7BN,EAAMK,GAAOC,cAAyBN,EAAMK,GAAOG,gBACjIR,EAAMK,GAAOI,YAAc,iBAKvC,IAAIC,IACAC,MAAOX,EACPY,UAAWC,EAAAC,WAAWC,kBAG1B,IAAIC,GAAAC,gBAAgB,mBAAmBC,cAAcC,KAAK,SAAUC,GAEhEV,EAAKE,UAAYC,EAAAC,WAAWC,kBAC5BM,SAASC,eAAe,2BAA2BC,UAAYH,EAASV,GAExEvB,GAEA,IAAIqC,EAKAA,GAAK,GAAIC,GAAAC,qBAAqBzB,MAElCuB,EAAGG,eAAe,iBAK1B/B,EAAAC,UAAA+B,YAAA,SAAYC,GACRzC,EAAE,sBAAsB0C,KAAK,6BAA+BD,EAAS,UAE7EjC,IA5CamC,GAAAnC,iBAAAA,EA8CbR,EAAEiC,UAAUW,GAAG,kBAAmB,SAAU1C,IACjB,GAAIM,IACVE,aAGrBiC,EAAA5C,oCAAAA","file":"Honeywell.ClientModel.EventsController.js","sourcesContent":["///<reference path=\"typings/handlebar/handlebars.d.ts\"/>\r\n/// <reference path=\"honeywell.clientmodel.paginationcontroller.ts\" />\r\nimport {DataService} from \"./Honeywell.ClientModel.DataService\";\r\nimport {TemplateService} from \"./Honeywell.ClientModel.TemplateService\";\r\nimport {MainHelper} from \"./Honeywell.ClientModel.MainHelper\";\r\nimport {PaginationController} from \"./Honeywell.Clientmodel.PaginationController\";\r\nimport * as Q from \"q\";\r\n\r\nvar currentCategory: string = \"\";\r\n\r\nexport class EventsController {\r\n\r\n    loadInfo() {\r\n\r\n    }\r\n\r\n    renderEventsList(items: any[], totalItemCount: number) {\r\n\r\n        if (items.length > 0) {\r\n            $('#js-load-info-li').show();\r\n            $(items).each(function (index) {\r\n                if ((items[index].RedirectURL === '' || items[index].RedirectURL === undefined || items[index].RedirectURL === null) && items[index].TrainingEvent) {\r\n                    items[index].TrainingUrl = 'TrainingUrl';\r\n                }\r\n            });\r\n        }\r\n\r\n        var data = {\r\n            Items: items,\r\n            userTerms: MainHelper.userLanguageTerms\r\n        }\r\n\r\n        new TemplateService(\"tpl_Events.html\").getTemplate().then(function (template: any) {\r\n\r\n            data.userTerms = MainHelper.userLanguageTerms;\r\n            document.getElementById('js-events-content-inner').innerHTML = template(data);\r\n\r\n            initializeEventsShowLongDescription();\r\n\r\n            var pc;\r\n            if (currentCategory) {\r\n                pc = new PaginationController(totalItemCount, [\"category=\" + currentCategory]);\r\n            }\r\n            else {\r\n                pc = new PaginationController(totalItemCount, []);\r\n            }\r\n            pc.loadPagination('EventsList');\r\n        });\r\n       \r\n    }\r\n\r\n    handleError(reason: string) {\r\n        $('#js-drawer-content').html(\"<h3>Failed To Load on page\" + reason + \"</h3>\");\r\n    }\r\n}\r\n\r\n$(document).on('SPContextLoaded', function (e) {\r\n    var eventsEventsList = new EventsController();\r\n    eventsEventsList.loadInfo();\r\n});\r\n\r\nexport function initializeEventsShowLongDescription() {\r\n    $(\".js-show-event-details\").click(function (e) {\r\n        e.preventDefault();\r\n        var $eventTarget = $(this).closest(\".event-object\").find(\".event-details\");\r\n        $eventTarget.slideToggle();\r\n    });\r\n}\r\n\r\n\r\n"]}