app/views/views_widgets/new.js.erb
$("#notifications").html("");
$(".modal-body-inner").html("<%= j render(:partial => "views_widgets/form") %>");
$("#myModalLabel").css('font-size', 'larger');
$("#myModalLabel").html('<%= I18n.t(:new_widget) %>');
$("#edit_component").modal({
keyboard: false,
backdrop: "static",
backdrop: false
});
$("#views_widget_icon_class").change(function(){
if ($(this).val() !== ""){
$("#view_icon_class_image").removeClass();
$("#view_icon_class_image").addClass( $(this).val());
$("#view_icon_class_image").addClass( "icon-large blue" );
}
else{
$("#view_icon_class_image").removeClass();
}
return false;
});
$("#views_widget_module_project_id").change(function() {
if ($(this).val() !== ""){
return $.ajax({
url: "/update_widget_module_project_data",
method: "GET",
data: "module_project_id=" + $(this).val()
});
}
});
$("#notifications").html("<%= j(render "layouts/notifications") %>");
$("#views_widget_color").colorpicker();