Created
April 5, 2017 11:27
-
-
Save sgaem/0e6015f81f9834e72751f82092914f4d to your computer and use it in GitHub Desktop.
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
$(document).on("dialog-ready", function () { | |
$(".js-coral-Multifield-add").click(function() { | |
var field = $(this).parent(); | |
var size = field.attr("data-limit"); | |
if (size) { | |
var ui = $(window).adaptTo("foundation-ui"); | |
var totalLinkCount = $(this).prev('ol').children('li').length; | |
if (totalLinkCount >= size) { | |
ui.alert("Warning", "Maximum " + size + " links are allowed!", "notice"); | |
return false; | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment