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 | 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 | 10 | firstBlockTypesGroup = jQuery(".block-types-group").first(); |
| 7 | 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 | 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 | 20 | activeBlockTypesGroup.removeClass('active'); |
| 16 | 21 | activeBlockTypesGroup.addClass('prev'); |
| 17 | - activeBlockTypesGroup.hide( 'slide', { direction : 'left' }, 1000 ); | |
| 18 | 22 | nextBlockTypesGroup.removeClass('next'); |
| 19 | 23 | nextBlockTypesGroup.addClass('active'); |
| 20 | 24 | jQuery(".block-types-group.active + .block-types-group").addClass('next'); |
| 21 | - nextBlockTypesGroup.show( 'slide', { direction : 'right' }, 1000 ); | |
| 22 | 25 | activeBlockTypesGroup = jQuery(".block-types-group.active"); |
| 23 | 26 | jQuery("#block-types-navigation a.previous").show(); |
| 24 | 27 | |
| 25 | 28 | if ( activeBlockTypesGroup.is( lastBlockTypesGroup ) ) { |
| 26 | 29 | jQuery("#block-types-navigation a.next").hide(); |
| 27 | 30 | } |
| 31 | + }); | |
| 28 | 32 | } |
| 29 | 33 | |
| 30 | 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 | 40 | activeBlockTypesGroup.removeClass('active'); |
| 34 | 41 | activeBlockTypesGroup.addClass('next'); |
| 35 | - activeBlockTypesGroup.hide( 'slide', { direction : 'right' }, 1000 ); | |
| 36 | 42 | previousBlockTypesGroup.removeClass('prev'); |
| 37 | 43 | previousBlockTypesGroup.addClass('active'); |
| 38 | - previousBlockTypesGroup.show( 'slide', { direction : 'left' }, 1000 ); | |
| 39 | 44 | activeBlockTypesGroup = jQuery(".block-types-group.active"); |
| 40 | 45 | jQuery("#block-types-navigation a.next").show(); |
| 41 | 46 | |
| 42 | 47 | if ( activeBlockTypesGroup.is( firstBlockTypesGroup ) ) { |
| 43 | 48 | jQuery("#block-types-navigation a.previous").hide(); |
| 44 | 49 | } |
| 50 | + }); | |
| 45 | 51 | } | ... | ... |