-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from backdrop-contrib/1.x-1.0.1
1.x 1.0.1
- Loading branch information
Showing
8 changed files
with
167 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
/** | ||
* @file | ||
* Sets options and starts Mosaic Grid script. | ||
* Sets options for lazyLoadXT plugin. | ||
*/ | ||
(function($) { | ||
|
||
Backdrop.behaviors.mosaic_grid = { | ||
attach: function (context, settings) { | ||
|
||
$.extend($.lazyLoadXT, { | ||
edgeY: settings.mosaic_grid.lazyload_edgeY, | ||
|
||
// Modified onload function that removes loader. | ||
onload: function() { | ||
// Basic functionality that shows image after it is loaded. | ||
$(this).removeClass('lazy-hidden'); | ||
$(this).addClass('lazy-loaded'); | ||
// Seek for item DIV that should be a parent for the image. | ||
var itemDiv = $(this).parent(); | ||
if(!itemDiv.hasClass('mosaic-grid-item')) { | ||
// In case image(IMG) is wrapped in a link(A) we need | ||
// to move one step higher in hierarchy. | ||
itemDiv = itemDiv.parent(); | ||
} | ||
// Delete loader DIV that is a children of the item. | ||
itemDiv.children('.mosaic-grid-loader').remove(); | ||
}, | ||
}); | ||
|
||
$('#mosaic-grid-gallery').Mosaic({ | ||
maxRowHeightPolicy: settings.mosaic_grid.max_row_height_policy, | ||
maxRowHeight: Number(settings.mosaic_grid.max_row_height), | ||
innerGap: Number(settings.mosaic_grid.inner_gap), | ||
outerMargin: Number(settings.mosaic_grid.outer_margin), | ||
maxRows: Number(settings.mosaic_grid.max_rows), | ||
refitOnResize: settings.mosaic_grid.refit_on_resize, | ||
refitOnResizeDelay: Number(settings.mosaic_grid.refit_on_resize_delay), | ||
responsiveWidthThreshold: Number(settings.mosaic_grid.responsive_width_threshold), | ||
maxItemsToShowWhenResponsiveThresholdSurpassed: Number(settings.mosaic_grid.max_items_threshold_surpassed), | ||
}); | ||
|
||
} | ||
}; | ||
|
||
})(jQuery); | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters