PHP Classes

File: template/Asset/tab-save

Recommend this page to a friend!
  Classes of Fabrice Fesch   Melis Tool Creator   template/Asset/tab-save   Download  
File: template/Asset/tab-save
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Melis Tool Creator
Module for the Melis CMS to create tools
Author: By
Last change:
Date: 1 year ago
Size: 1,907 bytes
 

Contents

Class file image Download
$("body").on("click", ".btnSaveModuleTpl", function(){ var btn = $(this); var id = $(this).data("id"); submitForm($("form#"+id+"_moduleTplForm"), id, btn); }); var submitForm = function(form, id, btn){ form.unbind("submit"); form.on("submit", function(e) { e.preventDefault(); btn.attr('disabled', true); var formData = new FormData(this); formData.append('#TCPKEY', id); #TCSAVELANG $.ajax({ type: 'POST', url: '/melis/ModuleTpl/Properties/save', data: formData, cache: false, contentType: false, processData: false, }).done(function (data) { if(data.success){ // Notifications melisHelper.melisOkNotification(data.textTitle, data.textMessage); // Reload List melisHelper.zoneReload("id_moduletpl_content", "moduletpl_content"); // Close add page $("a[data-id='"+id+"_id_moduletpl_properties_tool']").trigger("click"); // Open new created/updated entry melisHelper.tabOpen(data.entryTitle, 'fa fa-puzzle-piece', data.entryId+'_id_moduletpl_properties_tool', 'moduletpl_properties_tool', {id: data.entryId}, 'id_moduletpl_tool'); }else{ melisHelper.melisKoNotification(data.textTitle, data.textMessage, data.errors); melisHelper.highlightMultiErrors(data.success, data.errors, "#"+id+"_id_moduletpl_properties_content"); } btn.attr('disabled', false); }).fail(function () { alert(translations.tr_meliscore_error_message); }); }); form.submit(); };