Sha256: 084122b375ff09cb236656a31ef5e8135d370718f863a9e5605bc992c2046ae7

Contents?: true

Size: 970 Bytes

Versions: 4

Compression:

Stored size: 970 Bytes

Contents

function _railsBase_urlParams(param){
  urlParams = new URLSearchParams(window.location.search);
  return urlParams.get(param);
}

function _railsBase_goToStandardizedCollapse(q_param, identifier, function_base_name, function_yield){
  param = _railsBase_urlParams(q_param)
  if(param==null){
    return false
  }

  // Let callee decide if they want to continue
  if(typeof(function_yield) === "function") {
    if (function_yield(param) != true) {
      // Callee does not want to continue
      return
    }
  } else {
    // No function provided. Since the param was present, we will continue as expected
  }

  // Scroll to top of provided class
  $('html, body').animate({
    scrollTop: $(`${identifier}`).offset().top
  }, 'slow');


  // function name declared for the collapsable options
  // Toggle it and open it up
  console.log(`trying to open ${function_base_name}_collapse_toggle()`)
  eval(`${function_base_name}_collapse_toggle()`)

  return param
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_base-0.82.0 app/assets/javascripts/rails_base/rails_base_query_checker.js
rails_base-0.81.1 app/assets/javascripts/rails_base/rails_base_query_checker.js
rails_base-0.81.0 app/assets/javascripts/rails_base/rails_base_query_checker.js
rails_base-0.80.0 app/assets/javascripts/rails_base/rails_base_query_checker.js