MCPcopy Create free account
hub / github.com/breck7/scroll / toConfObject

Function toConfObject

external/.datatables.js:13771–13804  ·  view source on GitHub ↗
(base)

Source from the content-addressed store, hash-verified

13769 var dt = this.s.dt
13770 var i, ien
13771 var toConfObject = function (base) {
13772 var loop = 0
13773
13774 // Loop until we have resolved to a button configuration, or an
13775 // array of button configurations (which will be iterated
13776 // separately)
13777 while (!$.isPlainObject(base) && !Array.isArray(base)) {
13778 if (base === undefined) {
13779 return
13780 }
13781
13782 if (typeof base === "function") {
13783 base = base.call(that, dt, conf)
13784
13785 if (!base) {
13786 return false
13787 }
13788 } else if (typeof base === "string") {
13789 if (!_dtButtons[base]) {
13790 return { html: base }
13791 }
13792
13793 base = _dtButtons[base]
13794 }
13795
13796 loop++
13797 if (loop > 30) {
13798 // Protect against misconfiguration killing the browser
13799 throw "Buttons: Too many iterations"
13800 }
13801 }
13802
13803 return Array.isArray(base) ? base : $.extend({}, base)
13804 }
13805
13806 conf = toConfObject(conf)
13807

Callers 1

.datatables.jsFile · 0.85

Calls 1

extendMethod · 0.80

Tested by

no test coverage detected