cleanup
This commit is contained in:
@@ -8,10 +8,6 @@ using LeafWeb.Core.Entities;
|
|||||||
using LeafWeb.Core.Utility;
|
using LeafWeb.Core.Utility;
|
||||||
using LeafWeb.WebCms.Models;
|
using LeafWeb.WebCms.Models;
|
||||||
using Umbraco.Core;
|
using Umbraco.Core;
|
||||||
using Umbraco.Core.Models;
|
|
||||||
using Umbraco.Web;
|
|
||||||
using Umbraco.Web.PublishedCache;
|
|
||||||
using Umbraco.Web.Security;
|
|
||||||
|
|
||||||
namespace LeafWeb.WebCms.Services
|
namespace LeafWeb.WebCms.Services
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,90 +26,6 @@
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
// Making elements equal height
|
|
||||||
var equalheight = function(container){
|
|
||||||
|
|
||||||
var currentTallest = 0,
|
|
||||||
currentRowStart = 0,
|
|
||||||
rowDivs = new Array(),
|
|
||||||
$el,
|
|
||||||
topPosition = 0;
|
|
||||||
|
|
||||||
$(container).find('.equal').each(function() {
|
|
||||||
|
|
||||||
$el = $(this);
|
|
||||||
$($el).height('auto');
|
|
||||||
topPostion = $el.position().top;
|
|
||||||
|
|
||||||
if (currentRowStart !== topPostion) {
|
|
||||||
for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
|
|
||||||
rowDivs[currentDiv].height(currentTallest);
|
|
||||||
}
|
|
||||||
rowDivs.length = 0; // empty the array
|
|
||||||
currentRowStart = topPostion;
|
|
||||||
currentTallest = $el.height();
|
|
||||||
rowDivs.push($el);
|
|
||||||
} else {
|
|
||||||
rowDivs.push($el);
|
|
||||||
currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
|
|
||||||
}
|
|
||||||
for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
|
|
||||||
rowDivs[currentDiv].height(currentTallest);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Check for window width before resizing
|
|
||||||
function equalHeightChecker () {
|
|
||||||
if ( window.innerWidth > 767 && !heightIsSet ) {
|
|
||||||
$('.equalizer')
|
|
||||||
.each(function(){
|
|
||||||
equalheight(this);
|
|
||||||
heightIsSet = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if (window.innerWidth<768 && heightIsSet) {
|
|
||||||
$('.equalizer')
|
|
||||||
.each(function(){
|
|
||||||
$(this).find('.equal').each(function () {
|
|
||||||
this.style.height = 'auto';
|
|
||||||
});
|
|
||||||
heightIsSet = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize equal height script
|
|
||||||
var heightIsSet;
|
|
||||||
|
|
||||||
// On load
|
|
||||||
$(window).on('load', function() {
|
|
||||||
equalHeightChecker();
|
|
||||||
});
|
|
||||||
|
|
||||||
// and on resize
|
|
||||||
$(window).on('resize', function(){
|
|
||||||
equalHeightChecker();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Navigation
|
|
||||||
$('#toggle').click(function(){
|
|
||||||
$('.has-child').removeClass('selected');
|
|
||||||
$('nav').toggleClass('open');
|
|
||||||
$('.cross').toggleClass('open');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.has-child').click(function(){
|
|
||||||
if ( window.innerWidth < 768 ) {
|
|
||||||
if ( $( this ).hasClass('selected')){
|
|
||||||
$('.has-child').removeClass('selected');
|
|
||||||
} else {
|
|
||||||
$('.has-child').removeClass('selected');
|
|
||||||
$(this).toggleClass('selected');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}); */
|
|
||||||
|
|
||||||
$(".read-more")
|
$(".read-more")
|
||||||
.click(function () {
|
.click(function () {
|
||||||
@@ -121,19 +37,4 @@
|
|||||||
$(this).text("Show Less");
|
$(this).text("Show Less");
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://stackoverflow.com/a/58215644/99492
|
|
||||||
$.validator.setDefaults({
|
|
||||||
errorClass: "",
|
|
||||||
validClass: "",
|
|
||||||
highlight: function (element, errorClass, validClass) {
|
|
||||||
$(element).addClass("is-invalid").removeClass("is-valid");
|
|
||||||
$(element.form).find("[data-valmsg-for=" + element.id + "]").addClass("invalid-feedback");
|
|
||||||
},
|
|
||||||
unhighlight: function (element, errorClass, validClass) {
|
|
||||||
$(element).addClass("is-valid").removeClass("is-invalid");
|
|
||||||
$(element.form).find("[data-valmsg-for=" + element.id + "]").removeClass("invalid-feedback");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
Reference in New Issue
Block a user