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 /app | |
| parent | d48f166286d9224e4b7fe62ee3eb92c751d05753 (diff) | |
| download | chouette-core-785078284aeffdaf5b21dde2d46e3ff02bf3eadf.tar.bz2 | |
Expend map
Diffstat (limited to 'app')
| -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 |
3 files changed, 27 insertions, 3 deletions
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 |
