diff options
| author | Bruno Perles | 2015-11-04 17:57:02 +0100 |
|---|---|---|
| committer | Bruno Perles | 2015-11-05 10:54:00 +0100 |
| commit | 785078284aeffdaf5b21dde2d46e3ff02bf3eadf (patch) | |
| tree | 7f4890501c8d364f3ee049aaf5932b44fd8b591f | |
| parent | d48f166286d9224e4b7fe62ee3eb92c751d05753 (diff) | |
| download | chouette-core-785078284aeffdaf5b21dde2d46e3ff02bf3eadf.tar.bz2 | |
Expend map
| -rw-r--r-- | Gemfile | 4 | ||||
| -rw-r--r-- | Gemfile.lock | 24 | ||||
| -rw-r--r-- | app/assets/javascripts/tools.js.coffee | 13 | ||||
| -rw-r--r-- | app/assets/stylesheets/vendor/map_layers.css.scss | 15 | ||||
| -rw-r--r-- | app/maps/application_map.rb | 2 |
5 files changed, 43 insertions, 15 deletions
@@ -92,9 +92,9 @@ gem 'squeel' gem 'enumerize', '~> 0.10.0' -gem 'ninoxe', '1.2.4' +#gem 'ninoxe', '1.2.4' #gem 'ninoxe', github: 'afimb/ninoxe' -#gem 'ninoxe', path: '../ninoxe' +gem 'ninoxe', path: '../ninoxe' gem 'acts_as_list', '~> 0.6.0' gem 'acts_as_tree', '~> 2.1.0', require: 'acts_as_tree' diff --git a/Gemfile.lock b/Gemfile.lock index 6be7ca18f..fe55d41e1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,16 @@ +PATH + remote: ../ninoxe + specs: + ninoxe (1.2.4) + activerecord (~> 4.1.1) + acts-as-taggable-on (>= 3) + acts_as_list (>= 0.1.6) + acts_as_tree (>= 1.1.0) + deep_cloneable (~> 2.0.0) + enumerize (~> 0.10.0) + foreigner (= 1.6.0) + georuby-ext (= 0.0.5) + GEM remote: http://rubygems.org/ remote: https://rails-assets.org/ @@ -243,15 +256,6 @@ GEM net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) newrelic_rpm (3.9.6.257) - ninoxe (1.2.3) - activerecord (~> 4.1.1) - acts-as-taggable-on (>= 3) - acts_as_list (>= 0.1.6) - acts_as_tree (>= 1.1.0) - deep_cloneable (~> 2.0.0) - enumerize (~> 0.10.0) - foreigner (= 1.6.0) - georuby-ext (= 0.0.5) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) nokogiri (1.6.6.2-java) @@ -526,7 +530,7 @@ DEPENDENCIES meta_request mimemagic newrelic_rpm - ninoxe (= 1.2.3) + ninoxe! pg poltergeist pry-rails diff --git a/app/assets/javascripts/tools.js.coffee b/app/assets/javascripts/tools.js.coffee index b30eb6f15..e88c81efa 100644 --- a/app/assets/javascripts/tools.js.coffee +++ b/app/assets/javascripts/tools.js.coffee @@ -1,6 +1,19 @@ (($) -> $ -> $('.ce-hide').removeClass 'ce-hide' + $('[data-ce-action]').click -> + action = $(this).data('ce-action') + id = $(this).data('ce-id') + $map = $('#'+id) + height = $(window).height() + if (action == 'map-fullscreen') + if parseInt($map.css('height')) == height + $map.css('width', '') + $map.css('height', '') + else + $map.css('height', height).css('width', '100%') + $map.find('i').toggleClass('fa-expand fa-compress') + map.updateSize() return return ) jQuery diff --git a/app/assets/stylesheets/vendor/map_layers.css.scss b/app/assets/stylesheets/vendor/map_layers.css.scss index 835417ddc..0fe9e8151 100644 --- a/app/assets/stylesheets/vendor/map_layers.css.scss +++ b/app/assets/stylesheets/vendor/map_layers.css.scss @@ -3,8 +3,19 @@ p.after_map { } #map { + position: relative; float: right; width: 400px; height: 400px; - border: 1px solid gray; -}
\ No newline at end of file + border: 1px solid gray; + margin-bottom: 20px !important; +} +.ce-MapExpandBlock { + position: absolute; + top: -22px; + background-color: $brand-primary; + border: none; + height: 21px; + right: -1px; + color: white; +} diff --git a/app/maps/application_map.rb b/app/maps/application_map.rb index f6765dc2d..6de0ff8c2 100644 --- a/app/maps/application_map.rb +++ b/app/maps/application_map.rb @@ -73,7 +73,7 @@ class ApplicationMap def to_html(options = {}) if not respond_to?(:ready?) or ready? - "<div id=\"#{id}\" class=\"#{default_class}\"></div> #{map.to_html(options)}".html_safe + "<div id=\"#{id}\" class=\"#{default_class}\"><button data-ce-id=\"#{id}\" data-ce-action=\"map-fullscreen\" class=\"ce-MapExpandBlock\"><i class=\"fa fa-expand\"></i></button></div> #{map.to_html(options)}".html_safe end end |
