Comparing version 1.2.0 to 1.2.2
@@ -23,3 +23,3 @@ $(function() { | ||
e.preventDefault(); | ||
$('#'+$(this).data('rkd-modal-id')+' input.modal-state').prop('checked', true); | ||
$('#'+$(this).data('rkd-modal-id')+' input.modal-state').prop('checked', true).trigger('change'); | ||
}); | ||
@@ -26,0 +26,0 @@ |
@@ -1,1 +0,1 @@ | ||
$(function(){$(document).on("change",".modal-state",function(){$(this).is(":checked")?$("body").addClass("modal-open"):$("body").removeClass("modal-open")}),$(document).on("click",".modal-fade-screen, .modal-close",function(){$(".modal-state:checked").prop("checked",!1).change()}),$(document).on("click",".modal-inner",function(a){a.stopPropagation()}),$(document).on("click",".rkd-modal",function(a){a.preventDefault(),$("#"+$(this).data("rkd-modal-id")+" input.modal-state").prop("checked",!0)}),$(document).on("click",".rkd-modal-ajax, .rkd-modal-this",function(a){a.preventDefault();var b,c=$(this).data("rkd-modal-id");c?b=$("#"+c):(b=createAjaxModal(),$(this).data("rkd-modal-id",b.attr("id")));var d=b.find(".loading");if(b.find("input.modal-state").prop("checked",!0).change(),$(this).hasClass("rkd-modal-this"))return b.find(".modal-content").html($(this).html()),void d.hide();if(!b.hasClass("content-loaded")){var e=$(this).data("rkd-modal-selector");d.show(),$.ajax($(this).attr("href")).done(function(a){e?a=$(a).find(e):$(a).find(".rkd-modal-content")&&(a=$(a).find(".rkd-modal-content")),b.find(".modal-content").html(a),b.addClass("content-loaded")}).fail(function(){b.find(".modal-content").html("Something went wrong. Please try again later.")}).always(function(){d.hide()})}})});var createAjaxModal=function(){var a="_"+Math.random().toString(36).substr(2,9),b='<div class="modal" id="'+a+'"><input class="modal-state" type="checkbox" /><div class="modal-fade-screen"><div class="modal-inner"><!-- Close button--><div class="modal-close"></div><!-- Loader --><div class="sk-three-bounce loading"><div class="sk-child sk-bounce1"></div><div class="sk-child sk-bounce2"></div><div class="sk-child sk-bounce3"></div></div><!-- Content will be loaded in here with AJAX --><div class="modal-content"></div></div></div></div>';return $("body").append(b),$("#"+a)}; | ||
$(function(){$(document).on("change",".modal-state",function(){$(this).is(":checked")?$("body").addClass("modal-open"):$("body").removeClass("modal-open")}),$(document).on("click",".modal-fade-screen, .modal-close",function(){$(".modal-state:checked").prop("checked",!1).change()}),$(document).on("click",".modal-inner",function(a){a.stopPropagation()}),$(document).on("click",".rkd-modal",function(a){a.preventDefault(),$("#"+$(this).data("rkd-modal-id")+" input.modal-state").prop("checked",!0).trigger("change")}),$(document).on("click",".rkd-modal-ajax, .rkd-modal-this",function(a){a.preventDefault();var b,c=$(this).data("rkd-modal-id");c?b=$("#"+c):(b=createAjaxModal(),$(this).data("rkd-modal-id",b.attr("id")));var d=b.find(".loading");if(b.find("input.modal-state").prop("checked",!0).change(),$(this).hasClass("rkd-modal-this"))return b.find(".modal-content").html($(this).html()),void d.hide();if(!b.hasClass("content-loaded")){var e=$(this).data("rkd-modal-selector");d.show(),$.ajax($(this).attr("href")).done(function(a){e?a=$(a).find(e):$(a).find(".rkd-modal-content")&&(a=$(a).find(".rkd-modal-content")),b.find(".modal-content").html(a),b.addClass("content-loaded")}).fail(function(){b.find(".modal-content").html("Something went wrong. Please try again later.")}).always(function(){d.hide()})}})});var createAjaxModal=function(){var a="_"+Math.random().toString(36).substr(2,9),b='<div class="modal" id="'+a+'"><input class="modal-state" type="checkbox" /><div class="modal-fade-screen"><div class="modal-inner"><!-- Close button--><div class="modal-close"></div><!-- Loader --><div class="sk-three-bounce loading"><div class="sk-child sk-bounce1"></div><div class="sk-child sk-bounce2"></div><div class="sk-child sk-bounce3"></div></div><!-- Content will be loaded in here with AJAX --><div class="modal-content"></div></div></div></div>';return $("body").append(b),$("#"+a)}; |
{ | ||
"name": "rkd-modal", | ||
"version": "1.2.0", | ||
"version": "1.2.2", | ||
"description": "Plain content and AJAX supported modal.", | ||
@@ -43,5 +43,6 @@ "main": "Gruntfile.js", | ||
"spinkit": "^1.2.5", | ||
"bourbon-neat": "^1.9.1" | ||
"bourbon-neat": "^1.9.1", | ||
"merge": ">=1.2.1" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -0,1 +1,4 @@ | ||
![npm](https://img.shields.io/npm/dt/rkd-modal.svg) | ||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) | ||
# RKD Modal | ||
@@ -2,0 +5,0 @@ Plain content and AJAX supported modal. |
@@ -23,3 +23,3 @@ $(function() { | ||
e.preventDefault(); | ||
$('#'+$(this).data('rkd-modal-id')+' input.modal-state').prop('checked', true); | ||
$('#'+$(this).data('rkd-modal-id')+' input.modal-state').prop('checked', true).trigger('change'); | ||
}); | ||
@@ -26,0 +26,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29925
78
17