Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('[data-toggle="modal"]').click(function(e) {
- var mode = $(this).attr('mode')
- if(mode == 'edit_contact') {
- var url = '/dashboard/contact/detail/';
- var id = $(this).attr('id_contact');
- $.get(url+id+'/',function(data){
- $('#edit_contact').html(data);
- })
- }else if(mode == 'send_message') {
- var url = '/dashboard/contact/confirm/get_list_template/';
- var id_contact = $(this).attr('id_contact');
- $.get(url+id_contact+'/',function(data){
- $('#send_notification').html(data);
- });
- }
- });
- });
- function send_message(element) {
- var url = '/dashboard/contact/send_message/';
- $('#progress_send_email').show();
- $(element).addClass('disabled');
- $.post(url,$('#send_confirmation_form').serialize(),function(data){
- var cp_hash = $('#send_confirmation_form').find('input[name=contact_person_hash]').attr('value');
- $('#ajax_response_message').html(data.message);
- $('#ajax_response').show();
- $('#progress_send_email').fadeOut(2000);
- $('b[contact_person_hash='+cp_hash+']').hide().html('Just Now').css('color','green').fadeIn(300);
- $('#send_notification').modal('hide');
- },'json');
- }
- /*
- * contoh lain
- */
- $(document).ready(function(){
- $('#submit_modal_email').click(function(){
- tinyMCE.triggerSave();
- $.post('/dashboard/email_template/modify/',$('#modify_template_form').serialize(),
- function(data) {
- $('#notification_area').html('<button class="close" data-dismiss="alert">×</button>'+data.message);
- $('#notification_area').removeClass('hide');
- $('#myModal').modal('hide');
- $('#notification_area').delay(5000).fadeOut(1000);
- },'json'
- );
- });
- });
- $('[data-toggle="modal"]').click(function(e) {
- e.preventDefault();
- $('#loader_modal').show();
- var mode = $(this).attr('mode');
- var template_id = $(this).attr('template_id');
- var target = '/dashboard/email_template/detail'
- if(mode == 'edit') {
- $('#submit_modal_email').show();
- $('#modal_title_email').text('Edit Mode');
- $.get(target+'/'+mode+'/'+template_id+'/',function(data){
- $('#modal_body_email').html(data);
- $('#loader_modal').hide();
- tinyMCE.init({
- mode : "exact",
- elements : "textarea_eh,textarea_eb,textarea_ef",
- theme : "simple"
- });
- });
- }else if(mode == 'view') {
- $('#submit_modal_email').hide();
- $('#modal_title_email').text('View Mode');
- $.get(target+'/'+mode+'/'+template_id+'/',function(data){
- $('#modal_body_email').html(data);
- $('#loader_modal').hide();
- });
- }
- });
Add Comment
Please, Sign In to add comment