Browse Source

SVG fix for IE 9+

development
Godwin 11 years ago
parent
commit
cbb3164c6a
  1. 10
      app/assets/stylesheets/sass/_layout.scss
  2. 8
      app/helpers/application_helper.rb
  3. 9
      app/views/layouts/application.html.haml
  4. 8
      app/views/shared/_footer.html.haml

10
app/assets/stylesheets/sass/_layout.scss

@ -9,7 +9,6 @@ html {
}
body {
background-color: $primary-color;
height: auto;
}
@ -254,6 +253,10 @@ main {
@include breakpoint(large) {
overflow: auto;
footer {
@include clearfix;
}
}
}
@ -489,6 +492,7 @@ main {
border-radius: 0;
}
&:before,
&:after {
border-bottom-left-radius: inherit;
}
@ -548,6 +552,7 @@ main {
min-height: 5em;
background-color: inherit;
z-index: 1;
background-color: $primary-color;
i {
display: inline-block;
@ -982,3 +987,6 @@ table {
}
*/
.clearfix {
@include clearfix;
}

8
app/helpers/application_helper.rb

@ -436,7 +436,7 @@ module ApplicationHelper
end
def icon(id, attributes = nil)
('<svg' + hash_to_html_attributes(attributes) + '><use xlink:href="/assets/icons.svg#bb-icon-' + id + '"></use></svg>').html_safe
('<svg' + hash_to_html_attributes(attributes) + '><use xlink:href="' + cdn('/assets/icons.svg') + '#bb-icon-' + id + '"></use></svg>').html_safe
end
def static_map(location, zoom, width, height)
@ -452,7 +452,11 @@ module ApplicationHelper
end
end
(Rails.application.config.action_controller.asset_host || '')+"/maps/#{local_file_name}"
cdn("/maps/#{local_file_name}")
end
def cdn(file)
(Rails.application.config.action_controller.asset_host || '') + file
end
private

9
app/views/layouts/application.html.haml

@ -49,5 +49,14 @@
#content=yield
- else
= yield
%footer
#footer
.container= render 'shared/footer'
= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'
:javascript
#{yield :scripts}
!function(a,b,c,d){d&&a.addEventListener("DOMContentLoaded",function(){$.ajax({url:$("use").first().attr("xlink:href").replace(/^(.*)\#.*$/,"$1"),dataType:"text",success:function(a){$("body").append('<div class="hide">'+a+"</div>"),$("use").each(function(){$(this).attr("xlink:href",function(a,b){return b.replace(/^.*(#.*)$/,"$1")})})}})})}(document,navigator,{},/Trident\/[567]\b/.test(navigator.userAgent));
$(function(){
#{yield :dom_ready}
});
= yield :footer_scripts

8
app/views/shared/_footer.html.haml

@ -7,10 +7,4 @@
%a{href: '/conferences/'}='Zine'
.columns.medium-3.large-3.text-right
&copy;2014 Bike!Bike!
= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'
:javascript
#{yield :scripts}
$(function(){
#{yield :dom_ready}
});
= yield :footer_scripts

Loading…
Cancel
Save