Files
everything2/EveryThing/wwwroot/vendor/libs/bootstrap-table/extensions/multi-column-toggle/multi-column-toggle.js
David Štaleker 03b92525d7 Prvi commit
2023-05-12 09:00:07 +02:00

1 line
3.0 KiB
JavaScript

!function(t,o){var n=function(t){var o={};function n(e){if(o[e])return o[e].exports;var l=o[e]={i:e,l:!1,exports:{}};return t[e].call(l.exports,l,l.exports,n),l.l=!0,l.exports}return n.m=t,n.c=o,n.d=function(t,o,e){n.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:e})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,o){if(1&o&&(t=n(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var l in t)n.d(e,l,function(o){return t[o]}.bind(null,l));return e},n.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(o,"a",o),o},n.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},n.p="",n(n.s=419)}({419:function(t,o,n){n(420)},420:function(t,o){!function(t){"use strict";var o=t.fn.bootstrapTable.utils.sprintf,n=function(t){t.initHeader(),t.initSearch(),t.initPagination(),t.initBody()};t.extend(t.fn.bootstrapTable.defaults,{showToggleBtn:!1,multiToggleDefaults:[]}),t.fn.bootstrapTable.methods.push("hideAllColumns","showAllColumns");var e=t.fn.bootstrapTable.Constructor,l=e.prototype.initToolbar;e.prototype.initToolbar=function(){l.apply(this,Array.prototype.slice.apply(arguments));var t=this,o=this.$toolbar.find(">.btn-group");"string"==typeof this.options.multiToggleDefaults&&(this.options.multiToggleDefaults=JSON.parse(this.options.multiToggleDefaults)),this.options.showToggleBtn&&this.options.showColumns&&(o.append("<button class='btn btn-default hidden' id='showAllBtn'><span class='glyphicon glyphicon-resize-full icon-zoom-in'></span></button><button class='btn btn-default' id='hideAllBtn'><span class='glyphicon glyphicon-resize-small icon-zoom-out'></span></button>"),o.find("#showAllBtn").click(function(){t.showAllColumns(),o.find("#hideAllBtn").toggleClass("hidden"),o.find("#showAllBtn").toggleClass("hidden")}),o.find("#hideAllBtn").click(function(){t.hideAllColumns(),o.find("#hideAllBtn").toggleClass("hidden"),o.find("#showAllBtn").toggleClass("hidden")}))},e.prototype.hideAllColumns=function(){var e=this,l=e.options.multiToggleDefaults;t.each(this.columns,function(t,n){if(-1==l.indexOf(n.field)&&n.switchable){n.visible=!1;var i=e.$toolbar.find(".keep-open input").prop("disabled",!1);i.filter(o('[value="%s"]',t)).prop("checked",!1)}}),n(e)},e.prototype.showAllColumns=function(){var e=this;t.each(this.columns,function(t,n){n.switchable&&(n.visible=!0);var l=e.$toolbar.find(".keep-open input").prop("disabled",!1);l.filter(o('[value="%s"]',t)).prop("checked",!0)}),n(e),e.toggleColumn(0,e.columns[0].visible,!1)}}(jQuery)}});if("object"==typeof n){var e=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,t&&t!==window?t:null];for(var l in n)e[0]&&(e[0][l]=n[l]),e[1]&&"__esModule"!==l&&(e[1][l]=n[l]),e[2]&&(e[2][l]=n[l])}}(this);