(el: GridItemHTMLElement, opts: DDOpts | DDDropOpt, key?: DDKey, value?: DDValue)
| 150 | } |
| 151 | |
| 152 | public droppable(el: GridItemHTMLElement, opts: DDOpts | DDDropOpt, key?: DDKey, value?: DDValue): DDGridStack { |
| 153 | if (typeof opts.accept === 'function' && !opts._accept) { |
| 154 | opts._accept = opts.accept; |
| 155 | opts.accept = (el) => opts._accept(el); |
| 156 | } |
| 157 | this._getDDElements(el, opts).forEach(dEl => { |
| 158 | if (opts === 'disable' || opts === 'enable') { |
| 159 | dEl.ddDroppable && dEl.ddDroppable[opts](); |
| 160 | } else if (opts === 'destroy') { |
| 161 | dEl.ddDroppable && dEl.cleanDroppable(); |
| 162 | } else if (opts === 'option') { |
| 163 | dEl.setupDroppable({ [key]: value }); |
| 164 | } else { |
| 165 | dEl.setupDroppable(opts); |
| 166 | } |
| 167 | }); |
| 168 | return this; |
| 169 | } |
| 170 | |
| 171 | /** true if element is droppable */ |
| 172 | public isDroppable(el: DDElementHost): boolean { |
no test coverage detected