mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
4 lines
1.7 KiB
JavaScript
4 lines
1.7 KiB
JavaScript
/*! Foundation integration for DataTables' Editor
|
|
* © SpryMedia Ltd - datatables.net/license
|
|
*/
|
|
import jQuery from"jquery";import DataTable from"datatables.net-zf";import Editor from"datatables.net-editor";let $=jQuery;var reveal,Editor=DataTable.Editor,shown=(DataTable.Editor.defaults.display="foundation",$.extend(!0,$.fn.dataTable.Editor.classes,{field:{wrapper:"DTE_Field row",label:"small-4 columns inline",input:"small-8 columns",error:"error",multiValue:"panel radius multi-value",multiInfo:"small",multiRestore:"panel radius multi-restore","msg-labelInfo":"label secondary","msg-info":"label secondary","msg-message":"label secondary","msg-error":"label alert"},form:{button:"button small",buttonInternal:"button small"}}),!1);const dom={content:$('<div class="reveal reveal-modal DTED" data-reveal></div>'),close:$('<button class="close close-button">×</div>')};DataTable.Editor.display.foundation=$.extend(!0,{},DataTable.Editor.models.displayController,{init:function(e){return reveal=reveal||new window.Foundation.Reveal(dom.content,{closeOnClick:!1}),DataTable.Editor.display.foundation},open:function(o,e,t){var l=dom.content;l.children().detach(),l.append(e),l.prepend(dom.close),dom.close.attr("title",o.i18n.close).off("click.dte-zf").on("click.dte-zf",function(){o.close("icon")}),$(document).off("click.dte-zf").on("click.dte-zf","div.reveal-modal-bg, div.reveal-overlay",function(e){$(e.target).closest(dom.content).length||o.background()}),shown?t&&t():(shown=!0,$(dom.content).one("open.zf.reveal",function(){t&&t()}),reveal.open())},close:function(e,o){shown&&(reveal.close(),shown=!1),o&&o()},node:function(e){return dom.content[0]}});export default Editor; |