Sha256: ade09b86ea1fac0ab1d33dcb0bb92a77b7a7605215b36775a39761720485f662

Contents?: true

Size: 972 Bytes

Versions: 10

Compression:

Stored size: 972 Bytes

Contents

// override this file in your application to add custom behaviour

console.log("Thecore UI Rails Admin")

function hideBreadCrumbAndToolbar() {
    // If the page loaded has a tag like <span class="hide-breadcrumb hide-toolbar"></span>
    // then hide the elements

    // var actionName = "#{action_name}"
    // var isRoot = "#{RailsAdmin::Config::Actions.find(action_name.to_sym).root?}"

    // console.log(actionName, isRoot)

    if ($(".hide-breadcrumb").length) $(".breadcrumb").hide()
    else $(".breadcrumb").show()

    if ($(".hide-toolbar").length) $(".breadcrumb + .nav.nav-tabs").hide()
    else $(".breadcrumb + .nav.nav-tabs").show()
}


function adjustIframe(obj) {
    obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}

// Re evaluate at each iteraction
$(document).off('ready pjax:success', hideBreadCrumbAndToolbar);
$(document).on('ready pjax:success', hideBreadCrumbAndToolbar);

//= require 'rails_admin/custom/thecore/ui'

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
thecore_ui_rails_admin-3.0.11 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.10 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.9 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.8 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.7 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.6 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.5 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.4 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.3 app/assets/javascripts/rails_admin/custom/ui.js
thecore_ui_rails_admin-3.0.0 app/assets/javascripts/rails_admin/custom/ui.js