Bootstrap 4 JS file and editor.bootstrap4.min.js conflict

Bootstrap 4 JS file and editor.bootstrap4.min.js conflict

davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

I use bootstrap for my website. I have the cdn bootstrap https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js This seems to conflict with the editor bootstrap4 js file that is included with the DL. On pages with an editor I have to click the nav menu twice to get it to activate. This should not be the behavior. Any plans on fixing this issue?

/*!
 Bootstrap integration for DataTables' Editor
 ©2015 SpryMedia Ltd - datatables.net/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var h=a[d];if(b.call(c,h,d,a))return{i:d,v:h}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){a=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,b,c,e){if(b){c=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];d in c||(c[d]={});c=c[d]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");
(function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-editor"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,c){b||(b=window);c&&c.fn.dataTable||(c=require("datatables.net-bs4")(b,c).$);c.fn.dataTable.Editor||require("datatables.net-editor")(b,c);return a(c,b,b.document)}:a(jQuery,window,document)})(function(a,b,c,e){var d=a.fn.dataTable;d.Editor.defaults.display="bootstrap";b=d.Editor.defaults.i18n;
b.create.title='<h5 class="modal-title">'+b.create.title+"</h5>";b.edit.title='<h5 class="modal-title">'+b.edit.title+"</h5>";b.remove.title='<h5 class="modal-title">'+b.remove.title+"</h5>";if(b=d.TableTools)b.BUTTONS.editor_create.formButtons[0].className="btn btn-primary",b.BUTTONS.editor_edit.formButtons[0].className="btn btn-primary",b.BUTTONS.editor_remove.formButtons[0].className="btn btn-danger";a.extend(!0,a.fn.dataTable.Editor.classes,{header:{wrapper:"DTE_Header modal-header"},body:{wrapper:"DTE_Body modal-body"},
footer:{wrapper:"DTE_Footer modal-footer"},form:{tag:"form-horizontal",button:"btn",buttonInternal:"btn btn-outline-secondary"},field:{wrapper:"DTE_Field form-group row",label:"col-lg-4 col-form-label",input:"col-lg-8",error:"error is-invalid","msg-labelInfo":"form-text text-secondary small","msg-info":"form-text text-secondary small","msg-message":"form-text text-secondary small","msg-error":"form-text text-danger small",multiValue:"card multi-value",multiInfo:"small",multiRestore:"card multi-restore"}});
a.extend(!0,d.ext.buttons,{create:{formButtons:{className:"btn-primary"}},edit:{formButtons:{className:"btn-primary"}},remove:{formButtons:{className:"btn-danger"}}});d.Editor.display.bootstrap=a.extend(!0,{},d.Editor.models.displayController,{init:function(b){var g={content:a('<div class="modal fade DTED"><div class="modal-dialog modal-dialog-scrollable"></div></div>'),close:a('<button class="close">&times;</div>').attr("title",b.i18n.close).on("click",function(){b.close("icon")}),shown:!1,fullyShow:!1},
f=!1;a(c).on("mousedown","div.modal",function(b){f=a(b.target).hasClass("modal")&&g.shown?!0:!1});a(c).on("click","div.modal",function(c){a(c.target).hasClass("modal")&&f&&b.background()});b.on("displayOrder.dtebs",function(c,d,f,g){a.each(b.s.fields,function(b,c){a("input:not([type=checkbox]):not([type=radio]), select, textarea",c.node()).addClass("form-control")})});b._bootstrapDisplay=g;return d.Editor.display.bootstrap},open:function(b,c,d){var f=b._bootstrapDisplay;a(c).addClass("modal-content");
if(f._shown){var e=f.content.find("div.modal-dialog");e.children().detach();e.append(c);d&&d()}else f.shown=!0,f.fullyDisplayed=!1,e=f.content.find("div.modal-dialog"),e.children().detach(),e.append(c),a("div.modal-header",c).append(f.close),a(f.content).one("shown.bs.modal",function(){b.s.setFocus&&b.s.setFocus.focus();f.fullyDisplayed=!0;d&&d()}).one("hidden",function(){f.shown=!1}).appendTo("body").modal({backdrop:"static",keyboard:!1})},close:function(b,c){var d=b._bootstrapDisplay;if(d.shown)if(d.fullyDisplayed)a(d.content).one("hidden.bs.modal",
function(){a(this).detach()}).modal("hide"),d.shown=!1,d.fullyDisplayed=!1,c&&c();else a(d.content).one("shown.bs.modal",function(){d.close(b,c)});else c&&c()},node:function(a){return a._bootstrapDisplay.content[0]}});return d.Editor});

Replies

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    This is an Editor example with Bootstrap 4.1.3 and it appears to work correctly:
    https://editor.datatables.net/examples/styling/bootstrap4.html

    On pages with an editor I have to click the nav menu twice to get it to activate.

    What is the "nav menu" you are clicking?

    Can you post a link to your page or a test case replicating the issue so we can help debug?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

    @kthorngren Unfortunately my site is an Intranet. Not able to access offsite.

    Here is my header file though.

        <link rel="stylesheet" href="/assets/css.css?v=2.6.3">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
        <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.16.0/moment.min.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
    
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    
        <link rel="stylesheet" type="text/css" href="/assets/DataTables/datatables.css?v=2.6.3"/>
        <script type="text/javascript" src="/assets/DataTables/datatables.js"></script>
        <script src="https://unpkg.com/@travishorn/session-timeout"></script>
     <script src="https://cdn.tiny.cloud/1/tmr5konb516id87k3moyyk1vkpwoc9twj9xy8hsccppn6v2i/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    <script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/searchpanes/1.1.1/js/dataTables.searchPanes.min.js"></script>
    
    <script type="text/javascript" charset="utf-8" src="js/dataTables.editor.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="js/editor.bootstrap4.min.js"></script>
    <!--<script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"></script> -->
    <script type="text/javascript" charset="utf-8" src="js/query.js"></script>
    
    <link rel="stylesheet" href="/assets/css.css?v=2.6.3">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/assets/DataTables/datatables.css?v=2.6.3"/>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/searchpanes/1.1.1/css/searchPanes.dataTables.min.css"/>
    <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
    
    <script src="https://kit.fontawesome.com/d4de51ecf0.js" crossorigin="anonymous"></script>
    </head>
        
    
  • davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

    and my nav

    <nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #737373; ">
          <div class="container-fluid">
            <a class="navbar-brand" href="/"><img src="/assets/logo.png"> <span class="logo_text">Admin Portal</span></a>
    
          <button type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler">
            <span class="navbar-toggler-icon"></span>
          </button>
    
    
          <div id="navbarContent" class="collapse navbar-collapse">
              <ul class="navbar-nav mr-auto">
                        <li class="nav-item">
                  <a class="nav-link" href="/user">Home</a>
                </li>
    
                        <li class="nav-item">
                            <a class="nav-link" href="/scorecard">Scorecards</a>
                        </li>
    
    
    
                <!-- nav dropdown -->
                <li class="nav-item dropdown">
    
                  <a href="#" data-toggle="dropdown" class="nav-link dropdown-toggle">Discrepancy</a>
                  <ul class="dropdown-menu">
    
                    <li><a href="/datascape" class="dropdown-item">Datascape Discrepancy</a></li>
    
                    <!-- lvl 1 dropdown -->
    
                                <li class="dropdown-submenu">
                                 <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Commissions Discrepancy</a>
                                 <ul class="dropdown-menu">
    
    
                                     <a class="dropdown-item" href="/reconcile/act_reconcile.php">Activations Reconcile - RQ</a>
                                    <a class="dropdown-item" href="/reconcile/act_reconcile_vzw.php">Activations Reconcile - VZW</a>
                                    <a class="dropdown-item" href="/reconcile/up_reconcile.php">Upgrades Reconcile - RQ</a>
                                    <a class="dropdown-item" href="/reconcile/up_reconcile_vzw.php">Upgrades Reconcile - VZW</a>
                                    <a class="dropdown-item" href="/reconcile/opt_reconcile.php">Optional Services Reconcile - RQ</a>
                                    <a class="dropdown-item" href="/reconcile/opt_reconcile_vzw.php">Optional Services Reconcile - VZW</a>
    
    
                                 </ul>
                             </li>
    
                             <li class="dropdown-submenu">
                                <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Daily Discrepancy</a>
                                <ul class="dropdown-menu">
                                <a class="dropdown-item" href="/daily_discrep/activations.php">Activations Discrepancy - RQ</a>
                                <a class="dropdown-item" href="/daily_discrep/upgrades.php">Upgrades Discrepancy - RQ</a>
                                <a class="dropdown-item" href="/daily_discrep/optionalServices.php">Optional Services Discrepancy - RQ</a>
                                </ul>
                            </li>
                            <li><a class="dropdown-item" href="/dpExpected">Device Payment Expected</a></li>
    
    
                  </ul>
                </li>
    
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                Commissions
                            </a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                                <a class="dropdown-item" href="/commissions/searchIMEI/index2.php">Search IMEI</a>
                                <a class="dropdown-item" href="/customer_search">Search Customer Name / Mobile #</a>
                                <a class="dropdown-item" href="/commissions/activations.php">Activations</a>
                                <a class="dropdown-item" href="/commissions/upgrades.php">Upgrades</a>
                                <a class="dropdown-item" href="/commissions/optionalservices.php">Optional Services </a>
                                <a class="dropdown-item" href="/commissions/optservicedeact.php">Optional Services Deact.</a>
                                <a class="dropdown-item" href="/commissions/upgradeDeact.php">Upgrade Deact.</a>
                                <a class="dropdown-item" href="/commissions/upPlanChange.php">Upgrade Plan Change</a>
                                <a class="dropdown-item" href="/commissions/chargebacks.php">Chargebacks </a>
                                <a class="dropdown-item" href="/commissions/upPlanChargeback.php">Upgrade Plan Chargebacks</a>
                                <a class="dropdown-item" href="/commissions/securityDeposit.php">Security Deposit  </a>
                                <a class="dropdown-item" href="/commissions/mobileadjustments.php">Mobile Adjustments </a>
                                <a class="dropdown-item" href="/commissions/coopActivations.php">Coop Activations </a>
                                <a class="dropdown-item" href="/commissions/coopDeacts.php">Coop Deactivations </a>
                                <a class="dropdown-item" href="/commissions/transChanges.php">Transaction Changes </a>
                                <a class="dropdown-item" href="/commissions/reactivations.php">Reactivations </a>
                            </div>
    
                        </li>
    
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                Tools
                            </a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                                <a class="dropdown-item" href="/missed_opportunity">Missed Opportunity</a>
                                <a class="dropdown-item" href="/smb">SMB - No ECPD Profile </a>
                                <a class="dropdown-item" href="/smb/index2.php">SMB - Existing Customers </a>
                                <a class="dropdown-item" href="/smb/rqExisting">SMB - Existing RQ Customers </a>
                                <a class="dropdown-item" href="/tools/location.php">Location Information </a>
                            </div>
                        </li>
    
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                Requests
                            </a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                                <a class="dropdown-item" href="/idRequest">ID Request Form</a>
                                <a class="dropdown-item" href="/rma">RMA Request Form </a>
                                <a class="dropdown-item" href="/skuRequest">SKU Request Form</a>
                                <a class="dropdown-item" href="/idTermination">ID Termination Form</a>
    
                            </div>
                        </li>
    
    
                        <li class="nav-item dropdown">
    
                          <a href="#" data-toggle="dropdown" class="nav-link dropdown-toggle">Admin Menu</a>
                          <ul class="dropdown-menu">
    
                                <li class="dropdown-submenu">
                                 <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">ID, RMA, SKU Requests</a>
                                 <ul class="dropdown-menu">
    
                                 <a class="dropdown-item" href="/admin/idRequest">ID Requests</a>
                                 <a class="dropdown-item" href="/admin/sku">SKU Requests</a>
                                 <a class="dropdown-item" href="/admin/rma">RMA Requests</a>
                                 <a class="dropdown-item" href="/admin/idTerminations">ID Termination Form</a>
    
                                 </ul>
                                </li>
    
    
                                <li class="dropdown-submenu">
                                 <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Agent Profit Sheet</a>
                                 <ul class="dropdown-menu">
    
    
                                 <a class="dropdown-item" href="/agentProfit">Agent Profit Sheet</a>
                                 <a class="dropdown-item" href="/admin/agentProfit/insert.php">Add New Device</a>
                                 <a class="dropdown-item" href="/admin/agentProfit/profitUpdate.php">Update Devices</a>
                                 <a class="dropdown-item" href="/admin/agentProfit/">Bulk Upload</a>
    
    
                                 </ul>
                                </li>
    
                                <li class="dropdown-submenu">
                                 <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">User Tools</a>
                                 <ul class="dropdown-menu">
    
    
                                 <a class="dropdown-item" href="/register.php">Register User</a>
                                 <a class="dropdown-item" href="/admin/update_user">Update User / Password</a>
                                 <a class="dropdown-item" href="/admin/notes">Remove a Note</a>
                                 <a class="dropdown-item" href="/admin/user_track">User Login Track</a>
    
    
                                 </ul>
                             </li>
    
    
                            <li class="dropdown-submenu">
                             <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Daily Tasks</a>
                             <ul class="dropdown-menu">
    
    
                             <a class="dropdown-item" href="/admin/dpExpected">DP Expected</a>
                             <a class="dropdown-item" href="/admin/ispu">ISPU Upload from RQ</a>
                             <a class="dropdown-item" href="/admin/discrepancy">Upload Daily Discrepancy Files</a>
                             <a class="dropdown-item" href="/admin/ispu">ISPU Upload from RQ</a>
                             <a class="dropdown-item" href="/admin/orders/tracking.php">Upload Tracking Information</a>
    
    
                             </ul>
                            </li>
    
                                <li class="dropdown-submenu">
                                 <a href="#" role="button" data-toggle="dropdown" class="dropdown-item dropdown-toggle">Reports</a>
                                 <ul class="dropdown-menu">
                                     <a class="dropdown-item" href="/smb/smbReport.php">SMB Report</a>
                                 </ul>
                                </li>
                          <li>  <a class="dropdown-item" href="/admin/missedop/">Upload Missed Opps.</a></li>
                          <li>  <a class="dropdown-item" href="/admin/reconcile/">Upload RQ Commission Data</a></li>
                          <li>  <a class="dropdown-item" href="/admin/commissions/">Upload Data from Comms (VZW)</a></li>
                          <li>  <a class="dropdown-item" href="/admin/datascape">Upload Datascape Files</a></li>
                          <li>  <a class="dropdown-item" href="/admin/smb">Upload SMB Files</a></li>
                            <li><a class="dropdown-item" href="/admin/notifications">User Announcements</a></li>
                            <li><a class="dropdown-item" href="/admin/visualNav.php">Full Navigation Page</a></li>
    
                          </ul>
                        </li>
                <li class="nav-item ">
                  <a class="nav-link" href="/logout.php">Logout</a>
                </li>
    
    
              </ul>
            </div>
          </div>
        </nav>
    
  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    CSS is fiddly to debug without being able to see the issue occurring. As Kevin said, we would need to see this happening to be able to debug it.

    Colin

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Unfortunately my site is an Intranet. Not able to access offsite.

    Ok. Can you build a test case that replicates the issue?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    It doesn't need your specific data. This will give you a start with a basic editor.
    http://live.datatables.net/guwafemu/1/edit

    Kevin

  • davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

    We can close this thread. I moved the JS file to the bottom and that seems to have worked.

This discussion has been closed.