Skip to content

Commit

Permalink
Only load Section Organizer javascript (including masonry) on the Sec…
Browse files Browse the repository at this point in the history
…tion Organizer page

Fetch masonry from bower instead of using the masonry-rails gem
  • Loading branch information
tjgrathwell committed Jun 13, 2016
1 parent 29478c8 commit 4070657
Show file tree
Hide file tree
Showing 21 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ gem 'bootstrap-sass'
gem 'font-awesome-rails'
gem 'jquery-ui-rails'
gem 'backbone-on-rails'
gem 'masonry-rails'

group :development do
gem 'quiet_assets'
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ GEM
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
masonry-rails (0.2.4)
railties
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
Expand Down Expand Up @@ -371,7 +369,6 @@ DEPENDENCIES
jquery-rails
jquery-ui-rails
launchy
masonry-rails
nested_form
newrelic_rpm
omniauth-facebook
Expand Down
12 changes: 2 additions & 10 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery2
//= require jquery_ujs
//= require jquery-ui/datepicker
//= require bootstrap/transition
Expand All @@ -17,19 +17,11 @@
//= require gmaps/google
//= require backbone
//= require backbone-super
//= require masonry/jquery.masonry
//= require jquery.event.drag
//= require jquery.event.drop
//= require bridgetroll
//= require_tree ../templates
//= require_tree ./enums
//= require_tree ./models
//= require_tree ./collections
//= require ./views/base_view
//= require_tree ./views
//= require ./dialogs/base_dialog
//= require_tree ./dialogs
//= require DataTables
//= require DataTables/media/js/dataTables.bootstrap
//= stub section_organizer
//= require_tree .
//= require jquery_nested_form
9 changes: 9 additions & 0 deletions app/assets/javascripts/section_organizer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//= require masonry/dist/masonry.pkgd.js
//= require jquery.event.drag
//= require jquery.event.drop
//= require ./section_organizer/views/base_view
//= require ./section_organizer/dialogs/base_dialog
//= require_tree ./section_organizer/dialogs
//= require_tree ./section_organizer/models
//= require_tree ./section_organizer/collections
//= require_tree ./section_organizer/views
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Bridgetroll.Views.SectionOrganizer = (function () {
if (this.displayProperties.get('masonry')) {
this.$el.find('.masonry-container').masonry({
itemSelector: '.bridgetroll-section',
gutterWidth: 10
gutter: 10
});
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%= content_for(:header_text, @event.title) %>
<%= content_for(:header_link, event_organizer_tools_path(@event)) %>
<%= javascript_include_tag "section_organizer", defer: true %>
<%= render :partial => 'shared/organizer_breadcrumb', locals: {current_page_title: 'Section Organizer'} %>

Expand Down
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "bridge troll",
"dependencies": {
"DataTables": "1.10.10",
"select2": "4.0.1",
"markerclustererplus": "^2.1.4"
"DataTables": "1.10.12",
"select2": "4.0.3",
"markerclustererplus": "2.1.4",
"masonry": "4.1.0"
},
"devDependencies": {
"sinonjs": "1.17.1"
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w( markerclustererplus/dist/markerclusterer.min.js )
Rails.application.config.assets.precompile += %w( section_organizer.js markerclustererplus/dist/markerclusterer.min.js )

0 comments on commit 4070657

Please sign in to comment.