Bring and require jquery.vAlign.js from spree_backend

This commit is contained in:
luisramos0
2019-12-19 12:17:16 +00:00
parent a0575430dd
commit d424987587
2 changed files with 12 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
//= require jquery.powertip
//= require jquery.cookie
//= require jquery.jstree/jquery.jstree
//= require jquery.vAlign
//= require angular
//= require angular-resource
//= require angular-animate

View File

@@ -0,0 +1,11 @@
(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
return this.each(function(i){
var ah = $(this).height();
var ph = $(this).parent().height();
var mh = Math.ceil((ph-ah) / 2);
$(this).css('margin-top', mh);
});
};
})(jQuery);