sintonia/airtime_mvc/public/js/airtime/preferences/preferences.js
2011-06-15 11:17:03 -04:00

51 lines
1.1 KiB
JavaScript

$(document).ready(function() {
var form = $("form");
form.find("h3").click(function(){
var h3 = $(this);
h3.next().toggle();
if(h3.hasClass("close")) {
h3.removeClass("close");
}
else {
h3.addClass("close");
}
});
$('#Register').click(function(event){
event.preventDefault();
$.get("/Preference/register", {format:"json"}, function(json){
var dialog = $(json.dialog);
dialog.dialog({
autoOpen: false,
title: 'Register Airtime',
width: 400,
height: 500,
modal: true,
buttons: {"Ok": function() {
dialog.remove();
}}
});
dialog.dialog('open');
var form = $("form");
form.find("h3").click(function(){
var h3 = $(this);
h3.next().toggle();
if(h3.hasClass("close")) {
h3.removeClass("close");
}
else {
h3.addClass("close");
}
});
})
})
});