44 lines
946 B
JavaScript
44 lines
946 B
JavaScript
(function($) {
|
|
|
|
// disable anchors in menu links which are disabled
|
|
$("li.disabled a").click(function () {
|
|
return false;
|
|
});
|
|
|
|
$("form.confirm").submit(function () {
|
|
var form = this;
|
|
var text = "Confirm";
|
|
var confirmMsg = $(form).attr("confirm-msg");
|
|
if (confirmMsg) {
|
|
text = confirmMsg;
|
|
}
|
|
$("<div>" + text + "</div>")
|
|
.dialog({
|
|
title: "Confirm", // title
|
|
buttons: {
|
|
"Confirm": function () {
|
|
form.submit();
|
|
},
|
|
"Cancel": function () {
|
|
$(this).dialog("close");
|
|
}
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
$(".read-more")
|
|
.click(function () {
|
|
var control = $(this).attr('readcontrol');
|
|
$("#" + control).toggleClass("read-less");
|
|
if ($(this).text() === "Show Less")
|
|
$(this).text("Show More");
|
|
else
|
|
$(this).text("Show Less");
|
|
return false;
|
|
});
|
|
|
|
$(".click-submit").on('change', function () {
|
|
$(this).parents('form:first').submit();
|
|
});
|
|
})(jQuery); |