Add BumbleberryOverrideHelper for modern feature support and update main.js for responsive column visibility although not needed with override. Fixes #10
This commit is contained in:
@@ -166,6 +166,20 @@
|
||||
if (!window.initNodeFunctions) {
|
||||
window.initNodeFunctions = [];
|
||||
}
|
||||
|
||||
// this code is used to hide columns with class "column-set" on small screens
|
||||
// but is not really necessary, was fixed with bumbleberry_overridehelp.rb
|
||||
function handleColumnSetVisibility() {
|
||||
var isMobile = window.innerWidth <= 679;
|
||||
var elements = document.querySelectorAll('.table-th.column-set, th.column-set');
|
||||
elements.forEach(function(el) {
|
||||
el.style.display = isMobile ? 'none' : '';
|
||||
});
|
||||
}
|
||||
|
||||
window.initNodeFunctions.push(handleColumnSetVisibility);
|
||||
window.addEventListener('resize', handleColumnSetVisibility);
|
||||
|
||||
window.initNodeFunctions.push(function(node) {
|
||||
forEachElement('.number-field,.email-field,.text-field,.password-field,.search-field', function(field) {
|
||||
var input = field.querySelector('input');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
require 'net/https'
|
||||
|
||||
class ApplicationController < BaseController
|
||||
include BumbleberryOverrideHelper
|
||||
|
||||
protect_from_forgery with: :exception, except: [:do_confirm, :js_error, :admin_update]
|
||||
|
||||
before_filter :application_setup
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
module BumbleberryOverrideHelper
|
||||
MODERN_FEATURES = [:css3_boxsizing, :css_sel3, :flexbox, :css_grid, :svg].freeze
|
||||
|
||||
def capable_of(capability)
|
||||
if MODERN_FEATURES.include?(capability)
|
||||
true
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user