Files
IPB/static/js/cms/front_front_blocks.js
T
2025-12-19 16:27:35 -08:00

2 lines
830 B
JavaScript

;(function($,_,undefined){"use strict";ips.controller.register('cms.front.blocks.navigation',{initialize:function(){this.on('click','details',this.loadNavigationItems);var openSection=$(this.scope).find('details[open]:first');if(openSection.length){this.loadNavigationItems(null,openSection);}},loadNavigationItems:function(e,details=null){if(details===null){details=$(e.target).parents('details:first');}
var itemContainer=$(details).find('> [data-role="containerItems"]');var self=this;if(!itemContainer.html().trim().length){ips.getAjax()(ips.getSetting('baseURL')+'?app=cms&module=pages&controller=ajax&do=loadItems',{data:{navType:$(self.scope).attr('data-navType'),navId:$(self.scope).attr('data-navId'),container:$(details).data('container')}}).done(function(response){$(itemContainer).html(response);});}}});}(jQuery,_));;