[BUGFIX] Load clearable module in recycler 43/61843/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 26 Sep 2019 13:29:11 +0000 (15:29 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 27 Sep 2019 16:32:08 +0000 (18:32 +0200)
It was forgotten to load the new clearable module in the recycler
module.

Resolves: #89288
Related: #89215
Releases: master
Change-Id: I35f0e7b3d63112faf0c3fcfba7719141673856e6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61843
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Build/Sources/TypeScript/recycler/Resources/Public/TypeScript/Recycler.ts
typo3/sysext/recycler/Resources/Public/JavaScript/Recycler.js

index 6d4494f..d2ed845 100644 (file)
@@ -13,6 +13,7 @@
 
 import * as $ from 'jquery';
 import * as NProgress from 'nprogress';
+import 'TYPO3/CMS/Backend/Input/Clearable';
 import Modal = require('TYPO3/CMS/Backend/Modal');
 import Notification = require('TYPO3/CMS/Backend/Notification');
 import Severity = require('TYPO3/CMS/Backend/Severity');
index 63de183..134648b 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","jquery","nprogress","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Backend/Severity"],function(e,t,a,s,n,l,i){"use strict";var r;!function(e){e.searchForm="#recycler-form",e.searchText="#recycler-form [name=search-text]",e.searchSubmitBtn="#recycler-form button[type=submit]",e.depthSelector="#recycler-form [name=depth]",e.tableSelector="#recycler-form [name=pages]",e.recyclerTable="#itemsInRecycler",e.paginator="#recycler-index nav",e.reloadAction="a[data-action=reload]",e.massUndo="button[data-action=massundo]",e.massDelete="button[data-action=massdelete]",e.toggleAll=".t3js-toggle-all"}(r||(r={}));class o{constructor(){this.elements={},this.paging={currentPage:1,totalPages:1,totalItems:0,itemsPerPage:TYPO3.settings.Recycler.pagingSize},this.markedRecordsForMassAction=[],this.allToggled=!1,this.handleCheckboxSelects=(e=>{const t=a(e.currentTarget),s=t.parents("tr"),n=s.data("table")+":"+s.data("uid");if(t.prop("checked"))this.markedRecordsForMassAction.push(n),s.addClass("warning");else{const e=this.markedRecordsForMassAction.indexOf(n);e>-1&&this.markedRecordsForMassAction.splice(e,1),s.removeClass("warning")}if(this.markedRecordsForMassAction.length>0){this.elements.$massUndo.hasClass("disabled")&&this.elements.$massUndo.removeClass("disabled").removeAttr("disabled"),this.elements.$massDelete.hasClass("disabled")&&this.elements.$massDelete.removeClass("disabled").removeAttr("disabled");const e=this.createMessage(TYPO3.lang["button.undoselected"],[this.markedRecordsForMassAction.length]),t=this.createMessage(TYPO3.lang["button.deleteselected"],[this.markedRecordsForMassAction.length]);this.elements.$massUndo.find("span.text").text(e),this.elements.$massDelete.find("span.text").text(t)}else this.resetMassActionButtons()}),this.deleteRecord=(e=>{if(TYPO3.settings.Recycler.deleteDisable)return;const t=a(e.currentTarget).parents("tr"),s="TBODY"!==t.parent().prop("tagName");let l,r;if(s)l=this.markedRecordsForMassAction,r=TYPO3.lang["modal.massdelete.text"];else{const e=t.data("uid"),a=t.data("table"),s=t.data("recordtitle");l=[a+":"+e],r="pages"===a?TYPO3.lang["modal.deletepage.text"]:TYPO3.lang["modal.deletecontent.text"],r=this.createMessage(r,[s,"["+l[0]+"]"])}n.confirm(TYPO3.lang["modal.delete.header"],r,i.error,[{text:TYPO3.lang["button.cancel"],btnClass:"btn-default",trigger:function(){n.dismiss()}},{text:TYPO3.lang["button.delete"],btnClass:"btn-danger",trigger:()=>{this.callAjaxAction("delete",l,s)}}])}),this.undoRecord=(e=>{const t=a(e.currentTarget).parents("tr"),s="TBODY"!==t.parent().prop("tagName");let l,r,o;if(s)l=this.markedRecordsForMassAction,r=TYPO3.lang["modal.massundo.text"],o=!0;else{const e=t.data("uid"),a=t.data("table"),s=t.data("recordtitle");l=[a+":"+e],r=(o="pages"===a)?TYPO3.lang["modal.undopage.text"]:TYPO3.lang["modal.undocontent.text"],r=this.createMessage(r,[s,"["+l[0]+"]"]),o&&t.data("parentDeleted")&&(r+=TYPO3.lang["modal.undo.parentpages"])}let c=null;c=o?a("<div />").append(a("<p />").text(r),a("<div />",{class:"checkbox"}).append(a("<label />").append(TYPO3.lang["modal.undo.recursive"]).prepend(a("<input />",{id:"undo-recursive",type:"checkbox"})))):a("<p />").text(r),n.confirm(TYPO3.lang["modal.undo.header"],c,i.ok,[{text:TYPO3.lang["button.cancel"],btnClass:"btn-default",trigger:function(){n.dismiss()}},{text:TYPO3.lang["button.undo"],btnClass:"btn-success",trigger:()=>{this.callAjaxAction("undo","object"==typeof l?l:[l],s,c.find("#undo-recursive").prop("checked"))}}])}),a(()=>{this.initialize()})}static refreshPageTree(){top.TYPO3&&top.TYPO3.Backend&&top.TYPO3.Backend.NavigationContainer&&top.TYPO3.Backend.NavigationContainer.PageTree&&top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree()}getElements(){this.elements={$searchForm:a(r.searchForm),$searchTextField:a(r.searchText),$searchSubmitBtn:a(r.searchSubmitBtn),$depthSelector:a(r.depthSelector),$tableSelector:a(r.tableSelector),$recyclerTable:a(r.recyclerTable),$tableBody:a(r.recyclerTable).find("tbody"),$paginator:a(r.paginator),$reloadAction:a(r.reloadAction),$massUndo:a(r.massUndo),$massDelete:a(r.massDelete),$toggleAll:a(r.toggleAll)}}registerEvents(){this.elements.$searchForm.on("submit",e=>{e.preventDefault(),""!==this.elements.$searchTextField.val()&&this.loadDeletedElements()}),this.elements.$searchTextField.on("keyup",e=>{""!==a(e.currentTarget).val()?this.elements.$searchSubmitBtn.removeClass("disabled"):(this.elements.$searchSubmitBtn.addClass("disabled"),this.loadDeletedElements())}),this.elements.$searchTextField.get(0).clearable({onClear:()=>{this.elements.$searchSubmitBtn.addClass("disabled"),this.loadDeletedElements()}}),this.elements.$depthSelector.on("change",()=>{a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements()})}),this.elements.$tableSelector.on("change",()=>{this.paging.currentPage=1,this.loadDeletedElements()}),this.elements.$recyclerTable.on("click","[data-action=undo]",this.undoRecord),this.elements.$recyclerTable.on("click","[data-action=delete]",this.deleteRecord),this.elements.$reloadAction.on("click",e=>{e.preventDefault(),a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements()})}),this.elements.$paginator.on("click","a[data-action]",e=>{e.preventDefault();const t=a(e.currentTarget);let s=!1;switch(t.data("action")){case"previous":this.paging.currentPage>1&&(this.paging.currentPage--,s=!0);break;case"next":this.paging.currentPage<this.paging.totalPages&&(this.paging.currentPage++,s=!0);break;case"page":this.paging.currentPage=parseInt(t.find("span").text(),10),s=!0}s&&this.loadDeletedElements()}),TYPO3.settings.Recycler.deleteDisable?this.elements.$massDelete.remove():this.elements.$massDelete.show(),this.elements.$recyclerTable.on("show.bs.collapse hide.bs.collapse","tr.collapse",e=>{let t,s,n=a(e.currentTarget).prev("tr").find("[data-action=expand]").find(".t3-icon");switch(e.type){case"show":t="t3-icon-pagetree-collapse",s="t3-icon-pagetree-expand";break;case"hide":t="t3-icon-pagetree-expand",s="t3-icon-pagetree-collapse"}n.removeClass(t).addClass(s)}),this.elements.$toggleAll.on("click",()=>{this.allToggled=!this.allToggled,a('input[type="checkbox"]').prop("checked",this.allToggled).trigger("change")}),this.elements.$recyclerTable.on("change","tr input[type=checkbox]",this.handleCheckboxSelects),this.elements.$massUndo.on("click",this.undoRecord),this.elements.$massDelete.on("click",this.deleteRecord)}initialize(){s.configure({parent:".module-loading-indicator",showSpinner:!1}),this.getElements(),this.registerEvents(),TYPO3.settings.Recycler.depthSelection>0?this.elements.$depthSelector.val(TYPO3.settings.Recycler.depthSelection).trigger("change"):a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements()})}resetMassActionButtons(){this.markedRecordsForMassAction=[],this.elements.$massUndo.addClass("disabled").attr("disabled",!0),this.elements.$massUndo.find("span.text").text(TYPO3.lang["button.undo"]),this.elements.$massDelete.addClass("disabled").attr("disabled",!0),this.elements.$massDelete.find("span.text").text(TYPO3.lang["button.delete"])}loadAvailableTables(){return a.ajax({url:TYPO3.settings.ajaxUrls.recycler,dataType:"json",data:{action:"getTables",startUid:TYPO3.settings.Recycler.startUid,depth:this.elements.$depthSelector.find("option:selected").val()},beforeSend:()=>{s.start(),this.elements.$tableSelector.val(""),this.paging.currentPage=1},success:e=>{const t=[];this.elements.$tableSelector.children().remove(),a.each(e,(e,s)=>{const n=s[0],l=s[1],i=(s[2]?s[2]:TYPO3.lang.label_allrecordtypes)+" ("+l+")";t.push(a("<option />").val(n).text(i))}),t.length>0&&(this.elements.$tableSelector.append(t),""!==TYPO3.settings.Recycler.tableSelection&&this.elements.$tableSelector.val(TYPO3.settings.Recycler.tableSelection))},complete:()=>{s.done()}})}loadDeletedElements(){return a.ajax({url:TYPO3.settings.ajaxUrls.recycler,dataType:"json",data:{action:"getDeletedRecords",depth:this.elements.$depthSelector.find("option:selected").val(),startUid:TYPO3.settings.Recycler.startUid,table:this.elements.$tableSelector.find("option:selected").val(),filterTxt:this.elements.$searchTextField.val(),start:(this.paging.currentPage-1)*this.paging.itemsPerPage,limit:this.paging.itemsPerPage},beforeSend:()=>{s.start(),this.resetMassActionButtons()},success:e=>{this.elements.$tableBody.html(e.rows),this.buildPaginator(e.totalItems)},complete:()=>{s.done()}})}callAjaxAction(e,t,i,r=!1){let c={records:t,action:""},d=!1;if("undo"===e)c.action="undoRecords",c.recursive=r?1:0,d=!0;else{if("delete"!==e)return;c.action="deleteRecords"}a.ajax({url:TYPO3.settings.ajaxUrls.recycler,type:"POST",dataType:"json",data:c,beforeSend:()=>{s.start()},success:e=>{e.success?l.success("",e.message):l.error("",e.message),this.paging.currentPage=1,a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements(),i&&this.resetMassActionButtons(),d&&o.refreshPageTree(),this.allToggled=!1})},complete:()=>{n.dismiss(),s.done()}})}createMessage(e,t){return void 0===e?"":e.replace(/\{([0-9]+)\}/g,function(e,a){return t[a]})}buildPaginator(e){if(0===e)return void this.elements.$paginator.contents().remove();if(this.paging.totalItems=e,this.paging.totalPages=Math.ceil(e/this.paging.itemsPerPage),1===this.paging.totalPages)return void this.elements.$paginator.contents().remove();const t=a("<ul />",{class:"pagination pagination-block"}),s=[],n=a("<li />").append(a("<a />",{"data-action":"previous"}).append(a("<span />",{class:"t3-icon fa fa-arrow-left"}))),l=a("<li />").append(a("<a />",{"data-action":"next"}).append(a("<span />",{class:"t3-icon fa fa-arrow-right"})));1===this.paging.currentPage&&n.disablePagingAction(),this.paging.currentPage===this.paging.totalPages&&l.disablePagingAction();for(let e=1;e<=this.paging.totalPages;e++){const t=a("<li />",{class:this.paging.currentPage===e?"active":""});t.append(a("<a />",{"data-action":"page"}).append(a("<span />").text(e))),s.push(t)}t.append(n,s,l),this.elements.$paginator.html(t)}}return a.fn.disablePagingAction=function(){a(this).addClass("disabled").find(".t3-icon").unwrap().wrap(a("<span />"))},new o});
\ No newline at end of file
+define(["require","exports","jquery","nprogress","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Backend/Severity","TYPO3/CMS/Backend/Input/Clearable"],function(e,t,a,s,n,l,i){"use strict";var r;!function(e){e.searchForm="#recycler-form",e.searchText="#recycler-form [name=search-text]",e.searchSubmitBtn="#recycler-form button[type=submit]",e.depthSelector="#recycler-form [name=depth]",e.tableSelector="#recycler-form [name=pages]",e.recyclerTable="#itemsInRecycler",e.paginator="#recycler-index nav",e.reloadAction="a[data-action=reload]",e.massUndo="button[data-action=massundo]",e.massDelete="button[data-action=massdelete]",e.toggleAll=".t3js-toggle-all"}(r||(r={}));class o{constructor(){this.elements={},this.paging={currentPage:1,totalPages:1,totalItems:0,itemsPerPage:TYPO3.settings.Recycler.pagingSize},this.markedRecordsForMassAction=[],this.allToggled=!1,this.handleCheckboxSelects=(e=>{const t=a(e.currentTarget),s=t.parents("tr"),n=s.data("table")+":"+s.data("uid");if(t.prop("checked"))this.markedRecordsForMassAction.push(n),s.addClass("warning");else{const e=this.markedRecordsForMassAction.indexOf(n);e>-1&&this.markedRecordsForMassAction.splice(e,1),s.removeClass("warning")}if(this.markedRecordsForMassAction.length>0){this.elements.$massUndo.hasClass("disabled")&&this.elements.$massUndo.removeClass("disabled").removeAttr("disabled"),this.elements.$massDelete.hasClass("disabled")&&this.elements.$massDelete.removeClass("disabled").removeAttr("disabled");const e=this.createMessage(TYPO3.lang["button.undoselected"],[this.markedRecordsForMassAction.length]),t=this.createMessage(TYPO3.lang["button.deleteselected"],[this.markedRecordsForMassAction.length]);this.elements.$massUndo.find("span.text").text(e),this.elements.$massDelete.find("span.text").text(t)}else this.resetMassActionButtons()}),this.deleteRecord=(e=>{if(TYPO3.settings.Recycler.deleteDisable)return;const t=a(e.currentTarget).parents("tr"),s="TBODY"!==t.parent().prop("tagName");let l,r;if(s)l=this.markedRecordsForMassAction,r=TYPO3.lang["modal.massdelete.text"];else{const e=t.data("uid"),a=t.data("table"),s=t.data("recordtitle");l=[a+":"+e],r="pages"===a?TYPO3.lang["modal.deletepage.text"]:TYPO3.lang["modal.deletecontent.text"],r=this.createMessage(r,[s,"["+l[0]+"]"])}n.confirm(TYPO3.lang["modal.delete.header"],r,i.error,[{text:TYPO3.lang["button.cancel"],btnClass:"btn-default",trigger:function(){n.dismiss()}},{text:TYPO3.lang["button.delete"],btnClass:"btn-danger",trigger:()=>{this.callAjaxAction("delete",l,s)}}])}),this.undoRecord=(e=>{const t=a(e.currentTarget).parents("tr"),s="TBODY"!==t.parent().prop("tagName");let l,r,o;if(s)l=this.markedRecordsForMassAction,r=TYPO3.lang["modal.massundo.text"],o=!0;else{const e=t.data("uid"),a=t.data("table"),s=t.data("recordtitle");l=[a+":"+e],r=(o="pages"===a)?TYPO3.lang["modal.undopage.text"]:TYPO3.lang["modal.undocontent.text"],r=this.createMessage(r,[s,"["+l[0]+"]"]),o&&t.data("parentDeleted")&&(r+=TYPO3.lang["modal.undo.parentpages"])}let c=null;c=o?a("<div />").append(a("<p />").text(r),a("<div />",{class:"checkbox"}).append(a("<label />").append(TYPO3.lang["modal.undo.recursive"]).prepend(a("<input />",{id:"undo-recursive",type:"checkbox"})))):a("<p />").text(r),n.confirm(TYPO3.lang["modal.undo.header"],c,i.ok,[{text:TYPO3.lang["button.cancel"],btnClass:"btn-default",trigger:function(){n.dismiss()}},{text:TYPO3.lang["button.undo"],btnClass:"btn-success",trigger:()=>{this.callAjaxAction("undo","object"==typeof l?l:[l],s,c.find("#undo-recursive").prop("checked"))}}])}),a(()=>{this.initialize()})}static refreshPageTree(){top.TYPO3&&top.TYPO3.Backend&&top.TYPO3.Backend.NavigationContainer&&top.TYPO3.Backend.NavigationContainer.PageTree&&top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree()}getElements(){this.elements={$searchForm:a(r.searchForm),$searchTextField:a(r.searchText),$searchSubmitBtn:a(r.searchSubmitBtn),$depthSelector:a(r.depthSelector),$tableSelector:a(r.tableSelector),$recyclerTable:a(r.recyclerTable),$tableBody:a(r.recyclerTable).find("tbody"),$paginator:a(r.paginator),$reloadAction:a(r.reloadAction),$massUndo:a(r.massUndo),$massDelete:a(r.massDelete),$toggleAll:a(r.toggleAll)}}registerEvents(){this.elements.$searchForm.on("submit",e=>{e.preventDefault(),""!==this.elements.$searchTextField.val()&&this.loadDeletedElements()}),this.elements.$searchTextField.on("keyup",e=>{""!==a(e.currentTarget).val()?this.elements.$searchSubmitBtn.removeClass("disabled"):(this.elements.$searchSubmitBtn.addClass("disabled"),this.loadDeletedElements())}),this.elements.$searchTextField.get(0).clearable({onClear:()=>{this.elements.$searchSubmitBtn.addClass("disabled"),this.loadDeletedElements()}}),this.elements.$depthSelector.on("change",()=>{a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements()})}),this.elements.$tableSelector.on("change",()=>{this.paging.currentPage=1,this.loadDeletedElements()}),this.elements.$recyclerTable.on("click","[data-action=undo]",this.undoRecord),this.elements.$recyclerTable.on("click","[data-action=delete]",this.deleteRecord),this.elements.$reloadAction.on("click",e=>{e.preventDefault(),a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements()})}),this.elements.$paginator.on("click","a[data-action]",e=>{e.preventDefault();const t=a(e.currentTarget);let s=!1;switch(t.data("action")){case"previous":this.paging.currentPage>1&&(this.paging.currentPage--,s=!0);break;case"next":this.paging.currentPage<this.paging.totalPages&&(this.paging.currentPage++,s=!0);break;case"page":this.paging.currentPage=parseInt(t.find("span").text(),10),s=!0}s&&this.loadDeletedElements()}),TYPO3.settings.Recycler.deleteDisable?this.elements.$massDelete.remove():this.elements.$massDelete.show(),this.elements.$recyclerTable.on("show.bs.collapse hide.bs.collapse","tr.collapse",e=>{let t,s,n=a(e.currentTarget).prev("tr").find("[data-action=expand]").find(".t3-icon");switch(e.type){case"show":t="t3-icon-pagetree-collapse",s="t3-icon-pagetree-expand";break;case"hide":t="t3-icon-pagetree-expand",s="t3-icon-pagetree-collapse"}n.removeClass(t).addClass(s)}),this.elements.$toggleAll.on("click",()=>{this.allToggled=!this.allToggled,a('input[type="checkbox"]').prop("checked",this.allToggled).trigger("change")}),this.elements.$recyclerTable.on("change","tr input[type=checkbox]",this.handleCheckboxSelects),this.elements.$massUndo.on("click",this.undoRecord),this.elements.$massDelete.on("click",this.deleteRecord)}initialize(){s.configure({parent:".module-loading-indicator",showSpinner:!1}),this.getElements(),this.registerEvents(),TYPO3.settings.Recycler.depthSelection>0?this.elements.$depthSelector.val(TYPO3.settings.Recycler.depthSelection).trigger("change"):a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements()})}resetMassActionButtons(){this.markedRecordsForMassAction=[],this.elements.$massUndo.addClass("disabled").attr("disabled",!0),this.elements.$massUndo.find("span.text").text(TYPO3.lang["button.undo"]),this.elements.$massDelete.addClass("disabled").attr("disabled",!0),this.elements.$massDelete.find("span.text").text(TYPO3.lang["button.delete"])}loadAvailableTables(){return a.ajax({url:TYPO3.settings.ajaxUrls.recycler,dataType:"json",data:{action:"getTables",startUid:TYPO3.settings.Recycler.startUid,depth:this.elements.$depthSelector.find("option:selected").val()},beforeSend:()=>{s.start(),this.elements.$tableSelector.val(""),this.paging.currentPage=1},success:e=>{const t=[];this.elements.$tableSelector.children().remove(),a.each(e,(e,s)=>{const n=s[0],l=s[1],i=(s[2]?s[2]:TYPO3.lang.label_allrecordtypes)+" ("+l+")";t.push(a("<option />").val(n).text(i))}),t.length>0&&(this.elements.$tableSelector.append(t),""!==TYPO3.settings.Recycler.tableSelection&&this.elements.$tableSelector.val(TYPO3.settings.Recycler.tableSelection))},complete:()=>{s.done()}})}loadDeletedElements(){return a.ajax({url:TYPO3.settings.ajaxUrls.recycler,dataType:"json",data:{action:"getDeletedRecords",depth:this.elements.$depthSelector.find("option:selected").val(),startUid:TYPO3.settings.Recycler.startUid,table:this.elements.$tableSelector.find("option:selected").val(),filterTxt:this.elements.$searchTextField.val(),start:(this.paging.currentPage-1)*this.paging.itemsPerPage,limit:this.paging.itemsPerPage},beforeSend:()=>{s.start(),this.resetMassActionButtons()},success:e=>{this.elements.$tableBody.html(e.rows),this.buildPaginator(e.totalItems)},complete:()=>{s.done()}})}callAjaxAction(e,t,i,r=!1){let c={records:t,action:""},d=!1;if("undo"===e)c.action="undoRecords",c.recursive=r?1:0,d=!0;else{if("delete"!==e)return;c.action="deleteRecords"}a.ajax({url:TYPO3.settings.ajaxUrls.recycler,type:"POST",dataType:"json",data:c,beforeSend:()=>{s.start()},success:e=>{e.success?l.success("",e.message):l.error("",e.message),this.paging.currentPage=1,a.when(this.loadAvailableTables()).done(()=>{this.loadDeletedElements(),i&&this.resetMassActionButtons(),d&&o.refreshPageTree(),this.allToggled=!1})},complete:()=>{n.dismiss(),s.done()}})}createMessage(e,t){return void 0===e?"":e.replace(/\{([0-9]+)\}/g,function(e,a){return t[a]})}buildPaginator(e){if(0===e)return void this.elements.$paginator.contents().remove();if(this.paging.totalItems=e,this.paging.totalPages=Math.ceil(e/this.paging.itemsPerPage),1===this.paging.totalPages)return void this.elements.$paginator.contents().remove();const t=a("<ul />",{class:"pagination pagination-block"}),s=[],n=a("<li />").append(a("<a />",{"data-action":"previous"}).append(a("<span />",{class:"t3-icon fa fa-arrow-left"}))),l=a("<li />").append(a("<a />",{"data-action":"next"}).append(a("<span />",{class:"t3-icon fa fa-arrow-right"})));1===this.paging.currentPage&&n.disablePagingAction(),this.paging.currentPage===this.paging.totalPages&&l.disablePagingAction();for(let e=1;e<=this.paging.totalPages;e++){const t=a("<li />",{class:this.paging.currentPage===e?"active":""});t.append(a("<a />",{"data-action":"page"}).append(a("<span />").text(e))),s.push(t)}t.append(n,s,l),this.elements.$paginator.html(t)}}return a.fn.disablePagingAction=function(){a(this).addClass("disabled").find(".t3-icon").unwrap().wrap(a("<span />"))},new o});
\ No newline at end of file