YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Vtiger/resources/Tiles.min.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"Tiles.min.js","sources":["Tiles.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\n'use strict';\n$.Class(\n\t'Vtiger_Tiles_Js',\n\t{},\n\t{\n\t\tcontentContainer: false,\n\t\t/**\n\t\t * Register tiles size change action\n\t\t * @param {jQuery} topMenuContainer\n\t\t */\n\t\tregisterTileSizeChange: function (topMenuContainer) {\n\t\t\ttopMenuContainer.find('.js-tile-size').on('click', (e) => {\n\t\t\t\tlet selectedTileSize = $(e.currentTarget).attr('data-tile-size');\n\t\t\t\ttopMenuContainer.find('.js-tile-dropdown-title').text($(e.currentTarget).text());\n\t\t\t\ttopMenuContainer.find('.js-selected-tile-size').attr('data-selected-tile-size', selectedTileSize);\n\t\t\t\tapp.setMainParams('pageNumber', '1');\n\t\t\t\tapp.setMainParams('pageToJump', '1');\n\t\t\t\tlet urlParams = {\n\t\t\t\t\tviewname: this.listInstance.getCurrentCvId(),\n\t\t\t\t\tsearch_key: this.listInstance.getAlphabetSearchField(),\n\t\t\t\t\tsearch_value: '',\n\t\t\t\t\tsearch_params: '',\n\t\t\t\t\tadvancedConditions: '',\n\t\t\t\t\ttile_size: selectedTileSize\n\t\t\t\t};\n\t\t\t\tthis.contentContainer.find('#recordsCount').val('');\n\t\t\t\tthis.contentContainer.find('#totalPageCount').text('');\n\t\t\t\ttopMenuContainer.find('.pagination').data('totalCount', 0);\n\t\t\t\tthis.listInstance.getListViewRecords(urlParams).done(() => {\n\t\t\t\t\tthis.listInstance.updatePagination(1);\n\t\t\t\t\tthis.setHeightOfTiles(this.contentContainer);\n\t\t\t\t});\n\t\t\t\te.stopPropagation();\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Adjust height tile to the highest\n\t\t */\n\t\tsetHeightOfTiles: function () {\n\t\t\tlet maxHeight = -1;\n\t\t\tlet tiles = this.contentContainer.find('.js-tile-card');\n\t\t\ttiles.each(function () {\n\t\t\t\tmaxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();\n\t\t\t});\n\t\t\ttiles.each(function () {\n\t\t\t\t$(this).height(maxHeight);\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Function to register the click on the tile\n\t\t * @param {jQuery} tileContainer\n\t\t */\n\t\tregisterTileClickEvent: function (tileContainer) {\n\t\t\ttileContainer.on('click', '.js-card-body', function (e) {\n\t\t\t\tif ($(e.target).hasClass('js-show-image-preview')) return;\n\t\t\t\tif ($(e.target).closest('div').hasClass('actions')) return;\n\t\t\t\tif ($(e.target).is('button') || $(e.target).parent().is('button')) return;\n\t\t\t\tif ($(e.target).closest('a').hasClass('noLinkBtn')) return;\n\t\t\t\tif ($(e.target).is('input[type=\"checkbox\"]')) return;\n\t\t\t\tlet recordUrl = $(e.target).closest('.js-tile-container').data('recordurl');\n\t\t\t\tif (typeof recordUrl !== 'undefined') {\n\t\t\t\t\twindow.location.href = recordUrl;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Function which will give you all the list view params\n\t\t * @param {string} urlParams\n\t\t */\n\t\tgetListViewRecords: function (urlParams) {\n\t\t\tthis.listInstance.getListViewRecords(urlParams).done(() => {\n\t\t\t\tthis.setHeightOfTiles(this.contentContainer);\n\t\t\t});\n\t\t},\n\t\tregisterImagePreview() {\n\t\t\tthis.contentContainer.on('click', '.js-show-image-preview', (e) => {\n\t\t\t\tconst moduleName = this.contentContainer.find('[name=\"module\"]').length\n\t\t\t\t\t? this.contentContainer.find('[name=\"module\"]').val()\n\t\t\t\t\t: app.getModuleName();\n\t\t\t\tconst recordId = $(e.target).closest('.js-tile-container').attr('data-record-id');\n\t\t\t\tconst url = `index.php?module=${moduleName}&view=ImagePreview&record=${recordId}`;\n\t\t\t\tapp.showModalWindow('', url, (modalWindow) => {\n\t\t\t\t\tlet imageSrc = '';\n\t\t\t\t\tif ('IMG' === e.target.nodeName) {\n\t\t\t\t\t\timageSrc = $(e.target).attr('src');\n\t\t\t\t\t} else {\n\t\t\t\t\t\timageSrc = $(e.target).css('background-image');\n\t\t\t\t\t\timageSrc = imageSrc.replace('url(\"', '');\n\t\t\t\t\t\timageSrc = imageSrc.replace('\")', '');\n\t\t\t\t\t}\n\t\t\t\t\tmodalWindow.find('img.js-image-preview').attr('src', imageSrc);\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Register events\n\t\t */\n\t\tregisterEvents: function () {\n\t\t\tthis.listInstance = new Vtiger_List_Js();\n\t\t\tthis.listInstance.registerEvents();\n\t\t\tconst topMenuContainer = this.listInstance.getListViewTopMenuContainer();\n\t\t\tthis.contentContainer = this.listInstance.getListViewContainer();\n\t\t\tthis.registerTileSizeChange(topMenuContainer);\n\t\t\tthis.setHeightOfTiles();\n\t\t\tthis.registerTileClickEvent(this.contentContainer);\n\t\t\tthis.registerImagePreview();\n\t\t}\n\t}\n);\n"],"names":["$","Class","contentContainer","registerTileSizeChange","topMenuContainer","_this","find","on","e","selectedTileSize","currentTarget","attr","text","app","setMainParams","urlParams","viewname","listInstance","getCurrentCvId","search_key","getAlphabetSearchField","search_value","search_params","advancedConditions","tile_size","val","data","getListViewRecords","done","updatePagination","setHeightOfTiles","stopPropagation","maxHeight","tiles","each","height","registerTileClickEvent","tileContainer","target","hasClass","closest","is","parent","recordUrl","window","location","href","_this2","registerImagePreview","_this3","moduleName","length","getModuleName","recordId","url","concat","showModalWindow","modalWindow","imageSrc","nodeName","css","replace","registerEvents","Vtiger_List_Js","getListViewTopMenuContainer","getListViewContainer"],"mappings":";;AAAA,kKACA,YAAY,CACZA,CAAC,CAACC,KAAK,CACN,iBAAiB,CACjB,EAAE,CACF,CACCC,gBAAgB,GAAO;AAEzB;AACA;AACA,KACEC,sBAAsB,CAAE,SAAAA,sBAAAA,CAAUC,gBAAgB,CAAE,CAAA,IA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