Commit 7c1f50ea40992db45bd5ffd2122bcdf90780f1b0
1 parent
4c5ccf60
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
small fixes
Showing
1 changed file
with
20 additions
and
14 deletions
Show diff stats
public/javascripts/block_store.js
| 1 | jQuery(document).ready(function () { | 1 | jQuery(document).ready(function () { |
| 2 | - jQuery('#block-types-navigation a.previous').click(PreviousSlide); | ||
| 3 | - jQuery('#block-types-navigation a.next').click(NextSlide); | ||
| 4 | - jQuery('.block-types-group').first().addClass('active'); | ||
| 5 | - jQuery(".block-types-group.active + .block-types-group").addClass('next'); | 2 | + jQuery("#block-types-navigation a.previous").hide(); |
| 3 | + jQuery('.block-types-group').first().show( 'slide', { direction : 'down' }, 1000, function() { | ||
| 4 | + jQuery('.block-types-group').first().addClass('active'); | ||
| 5 | + jQuery(".block-types-group.active + .block-types-group").addClass('next'); | ||
| 6 | + jQuery('#block-types-navigation a.previous').click(PreviousSlide); | ||
| 7 | + jQuery('#block-types-navigation a.next').click(NextSlide); | ||
| 8 | + }); | ||
| 9 | + | ||
| 6 | firstBlockTypesGroup = jQuery(".block-types-group").first(); | 10 | firstBlockTypesGroup = jQuery(".block-types-group").first(); |
| 7 | lastBlockTypesGroup = jQuery(".block-types-group").last(); | 11 | lastBlockTypesGroup = jQuery(".block-types-group").last(); |
| 8 | - jQuery('.block-types-group').first().show( 'slide', { direction : 'down' }, 1000 ); | ||
| 9 | - jQuery("#block-types-navigation a.previous").hide(); | ||
| 10 | }); | 12 | }); |
| 11 | 13 | ||
| 12 | function NextSlide() { | 14 | function NextSlide() { |
| 13 | - activeBlockTypesGroup = jQuery(".block-types-group.active"); | ||
| 14 | - nextBlockTypesGroup = jQuery(".block-types-group.next").first(); | 15 | + activeBlockTypesGroup = jQuery(".block-types-group.active"); |
| 16 | + nextBlockTypesGroup = jQuery(".block-types-group.next").first(); | ||
| 17 | + | ||
| 18 | + activeBlockTypesGroup.hide( 'slide', { direction : 'left' }, 1000); | ||
| 19 | + nextBlockTypesGroup.show( 'slide', { direction : 'right' }, 1000, function() { | ||
| 15 | activeBlockTypesGroup.removeClass('active'); | 20 | activeBlockTypesGroup.removeClass('active'); |
| 16 | activeBlockTypesGroup.addClass('prev'); | 21 | activeBlockTypesGroup.addClass('prev'); |
| 17 | - activeBlockTypesGroup.hide( 'slide', { direction : 'left' }, 1000 ); | ||
| 18 | nextBlockTypesGroup.removeClass('next'); | 22 | nextBlockTypesGroup.removeClass('next'); |
| 19 | nextBlockTypesGroup.addClass('active'); | 23 | nextBlockTypesGroup.addClass('active'); |
| 20 | jQuery(".block-types-group.active + .block-types-group").addClass('next'); | 24 | jQuery(".block-types-group.active + .block-types-group").addClass('next'); |
| 21 | - nextBlockTypesGroup.show( 'slide', { direction : 'right' }, 1000 ); | ||
| 22 | activeBlockTypesGroup = jQuery(".block-types-group.active"); | 25 | activeBlockTypesGroup = jQuery(".block-types-group.active"); |
| 23 | jQuery("#block-types-navigation a.previous").show(); | 26 | jQuery("#block-types-navigation a.previous").show(); |
| 24 | 27 | ||
| 25 | if ( activeBlockTypesGroup.is( lastBlockTypesGroup ) ) { | 28 | if ( activeBlockTypesGroup.is( lastBlockTypesGroup ) ) { |
| 26 | jQuery("#block-types-navigation a.next").hide(); | 29 | jQuery("#block-types-navigation a.next").hide(); |
| 27 | } | 30 | } |
| 31 | + }); | ||
| 28 | } | 32 | } |
| 29 | 33 | ||
| 30 | function PreviousSlide() { | 34 | function PreviousSlide() { |
| 31 | - activeBlockTypesGroup = jQuery(".block-types-group.active"); | ||
| 32 | - previousBlockTypesGroup = jQuery(".block-types-group.prev").last(); | 35 | + activeBlockTypesGroup = jQuery(".block-types-group.active"); |
| 36 | + previousBlockTypesGroup = jQuery(".block-types-group.prev").last(); | ||
| 37 | + | ||
| 38 | + activeBlockTypesGroup.hide( 'slide', { direction : 'right' }, 1000 ); | ||
| 39 | + previousBlockTypesGroup.show( 'slide', { direction : 'left' }, 1000, function() { | ||
| 33 | activeBlockTypesGroup.removeClass('active'); | 40 | activeBlockTypesGroup.removeClass('active'); |
| 34 | activeBlockTypesGroup.addClass('next'); | 41 | activeBlockTypesGroup.addClass('next'); |
| 35 | - activeBlockTypesGroup.hide( 'slide', { direction : 'right' }, 1000 ); | ||
| 36 | previousBlockTypesGroup.removeClass('prev'); | 42 | previousBlockTypesGroup.removeClass('prev'); |
| 37 | previousBlockTypesGroup.addClass('active'); | 43 | previousBlockTypesGroup.addClass('active'); |
| 38 | - previousBlockTypesGroup.show( 'slide', { direction : 'left' }, 1000 ); | ||
| 39 | activeBlockTypesGroup = jQuery(".block-types-group.active"); | 44 | activeBlockTypesGroup = jQuery(".block-types-group.active"); |
| 40 | jQuery("#block-types-navigation a.next").show(); | 45 | jQuery("#block-types-navigation a.next").show(); |
| 41 | 46 | ||
| 42 | if ( activeBlockTypesGroup.is( firstBlockTypesGroup ) ) { | 47 | if ( activeBlockTypesGroup.is( firstBlockTypesGroup ) ) { |
| 43 | jQuery("#block-types-navigation a.previous").hide(); | 48 | jQuery("#block-types-navigation a.previous").hide(); |
| 44 | } | 49 | } |
| 50 | + }); | ||
| 45 | } | 51 | } |