Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Zmiany z wdrożenia #1

Open
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+52 −20
Split
View
@@ -39,7 +39,7 @@
opts = $.extend defaults, options
@each ->
$self = $ @
- $ul = $self.find(':not(.carousel-controls)').children 'ul'
+ $ul = $self.find(':not(.carousel-controls)').children 'ul:not(.nav)'
$li = $ul.find 'li'
$layers = $ul.find '.carousel-layer'
$nextArrow = $self.find '.next-arrow'
View
@@ -1,21 +1,6 @@
(($) ->
- $(document).ready ->
- $('.carousel-container').carousel 'ajax': yes
- $('.tiled-submenu').carousel()
- $('.timeline-carousel-container').carousel 'vertical': yes
-
- $('.timeline-carousel-container').carousel
- 'variableDimensions': yes
- 'vertical': yes
- 'onAnimationComplete': (index, $li) ->
- $('.decades li a').removeClass 'active'
- $('.decades li[data-decade="' + $li.attr('data-decade') + '"]').find('a').addClass 'active'
- $('.decades li[data-decade="' + $('.timeline-carousel li').eq(0).attr('data-decade') + '"]').find('a').addClass 'active'
- $('.decades li a').click ->
- $(@).parents('.timeline-container').find('.timeline-carousel-container').data('carousel').requestItem $.inArray $(@).parents('.timeline-container').find('.timeline-carousel li[data-decade="' + $(@).parent().attr('data-decade') + '"]')[0], $(@).parents('.timeline-container').find('.timeline-carousel li')
- no
-
+ animateNutritionFacts = () ->
$nutritionFactsButton = $ '.nutrition-facts-button'
$nutritionFacts = $ '.nutrition-facts'
$nutritionFacts.css 'display': 'none'
@@ -27,12 +12,48 @@
animationProperties = 'width' : "#{percent}%"
animationSettings = 'duration' : 'slow'
$bar.css('width': 0).stop(yes).delay('slow').animate animationProperties, animationSettings
+ return
$nutritionFacts.find('.close-button').click ->
$nutritionFacts.stop().slideUp()
$nutritionFactsButton.removeClass 'active'
no
- no
+ return
+ return
+
+ $(document).ready ->
+ $('.carousel-container').carousel
+ 'ajax': false
+ 'onAnimationInit': (index, el) ->
+ if $(el).data('request')
+ $.ajax
+ url: $(el).data('request'),
+ dataType: 'html',
+ method: 'POST',
+ success: (d) ->
+ $('#main-content').empty().append(d)
+ animateProductPage()
+ animateNutritionFacts()
+ no
+ if $(el).data('bg')
+ $(el).parents('.carousel').prev("img.carousel-bg").attr("src", $(el).data('bg'));
+ no
+
+ $('.tiled-submenu').carousel()
+ $('.timeline-carousel-container').carousel 'vertical': yes
+ $('.timeline-carousel-container').carousel
+ 'variableDimensions': yes
+ 'vertical': yes
+ 'onAnimationComplete': (index, $li) ->
+ $('.decades li a').removeClass 'active'
+ $('.decades li[data-decade="' + $li.attr('data-decade') + '"]').find('a').addClass 'active'
+ $('.decades li[data-decade="' + $('.timeline-carousel li').eq(0).attr('data-decade') + '"]').find('a').addClass 'active'
+ $('.decades li a').click ->
+ $(@).parents('.timeline-container').find('.timeline-carousel-container').data('carousel').requestItem $.inArray $(@).parents('.timeline-container').find('.timeline-carousel li[data-decade="' + $(@).parent().attr('data-decade') + '"]')[0], $(@).parents('.timeline-container').find('.timeline-carousel li')
+ no
+
+ animateNutritionFacts()
+
if Modernizr.touch
$('li').click ->
if $(@).children('.submenu').length
View
@@ -1,4 +1,5 @@
-$(document).ready(function() {
+
+function animateProductPage() {
setHeightBigP();
setHeightProduct();
@@ -43,6 +44,14 @@ $(document).ready(function() {
$(".tabs").tabs();
+ $('a.print').click(function(){
+ $('div.printable').jqprint();
+ return false;
+ })
+
+ // link do rozwin w "o Mc'Donalds"
+ $('#top-content .top-container-col .nav-arrow').append('<a class="fold ir" href="#default">zwiń</a>');
+
$("#cafe-accordion table tr td:first-child").each(function() {
$(this).addClass("td_1");
});
@@ -53,7 +62,9 @@ $(document).ready(function() {
$( "#cafe-accordion" ).accordion({ active: -1, autoHeight: false});
-});
+};
+
+$(document).ready(animateProductPage);
/*
* Set height to '.big_photo'