From 009250eba746e472c962e6c7054fdb03d3ab5a17 Mon Sep 17 00:00:00 2001 From: Marc Anguera Insa Date: Wed, 15 Aug 2018 19:47:14 +0200 Subject: [PATCH] :fire: jquery-ui: we only use the datepicker and in one place (statistics_global_activity view) so maybe it's fine to delete it and reduce assets bundle size :) --- Gemfile | 1 - Gemfile.lock | 3 --- app/assets/javascripts/application.js.coffee | 2 -- app/assets/javascripts/datepicker.js.coffee | 20 ------------------- app/assets/javascripts/libs.js | 1 - app/assets/stylesheets/application.css.scss | 9 --------- app/assets/stylesheets/libs.scss | 1 - .../statistics_global_activity.html.erb | 6 ++---- 8 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 app/assets/javascripts/datepicker.js.coffee diff --git a/Gemfile b/Gemfile index 3a36ae4cb..e386d1131 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,6 @@ gem 'rufus-scheduler', '~> 3.4.2' # Assets gem 'jquery-rails', '>= 4.2.0' -gem 'jquery-ui-rails' gem 'bootstrap-sass' gem 'sass-rails', '~> 5.0.7' gem 'coffee-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 6822349c2..e2e1f9011 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -180,8 +180,6 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (5.0.3) - railties (>= 3.2.16) json (2.1.0) kaminari (1.1.1) activesupport (>= 4.1.0) @@ -423,7 +421,6 @@ DEPENDENCIES hstore_translate http_accept_language (~> 2.1.1) jquery-rails (>= 4.2.0) - jquery-ui-rails kaminari (~> 1.1.1) letter_opener (= 1.4.1) localeapp (= 2.1.1) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 7bdc261c1..90a0a1a37 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -1,5 +1,3 @@ -#= require_self -#= require datepicker #= require give_time #= require tags #= require mobile_app_libs diff --git a/app/assets/javascripts/datepicker.js.coffee b/app/assets/javascripts/datepicker.js.coffee deleted file mode 100644 index f74b29052..000000000 --- a/app/assets/javascripts/datepicker.js.coffee +++ /dev/null @@ -1,20 +0,0 @@ -$ -> - $("input.datepicker").each (i) -> - $(this).datepicker - altFormat: "dd-mm-yy" - dateFormat: "dd/mm/yy" - altField: $(this).next() - $("#datepicker_from, #datepicker_to").datepicker - changeMonth: true - changeYear: true - showButtonPanel: true - dateFormat: "MM yy" - onClose: -> - month = $("#ui-datepicker-div .ui-datepicker-month :selected").val() - year = $("#ui-datepicker-div .ui-datepicker-year :selected").val() - $(this).datepicker "setDate", new Date(year, month, 1) - return - $("#datepicker_from, #datepicker_to").focus -> - $(".ui-datepicker-calendar").hide() - return - diff --git a/app/assets/javascripts/libs.js b/app/assets/javascripts/libs.js index 63a46c808..bc8647cb7 100644 --- a/app/assets/javascripts/libs.js +++ b/app/assets/javascripts/libs.js @@ -1,6 +1,5 @@ //= require jquery //= require jquery_ujs -//= require jquery-ui //= require jquery.validate //= require bootstrap //= require highcharts diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index b1455c6bd..828e5c541 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,7 +1,3 @@ -/* - *= require_self - */ - @import "variables"; @import "bootstrap-sprockets"; @import "bootstrap-custom"; @@ -312,11 +308,6 @@ ul.statistics li{ padding-left: 1.5rem; } -// if not navbar hidden datepicker in small windows -.ui-datepicker{ - z-index: 1000 !important; -} - // fields that contain an error .field_with_errors{ color: red; diff --git a/app/assets/stylesheets/libs.scss b/app/assets/stylesheets/libs.scss index 485de4a76..46c001a3f 100644 --- a/app/assets/stylesheets/libs.scss +++ b/app/assets/stylesheets/libs.scss @@ -1,4 +1,3 @@ /* -*= require jquery-ui *= require select2 */ diff --git a/app/views/statistics/statistics_global_activity.html.erb b/app/views/statistics/statistics_global_activity.html.erb index 498123883..d1da298c8 100644 --- a/app/views/statistics/statistics_global_activity.html.erb +++ b/app/views/statistics/statistics_global_activity.html.erb @@ -28,14 +28,12 @@