123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- @yield('main')
- <script>
- $(function(){
-
- $('.modal-date').flatpickr({
- dateFormat: 'd M Y'
- });
-
- $('.modal-time').flatpickr({
- noCalendar: true,
- enableTime: true,
- dateFormat: "h:i K",
- });
-
- $('.modal-form').on('submit', function(event){
-
- event.preventDefault();
- var self=$(this);
-
- $('.btn-submit').prop('disabled', true);
-
- $(self).waitMe({
- effect: 'facebook',
- text: 'Please! Wait ...'
- });
-
- $(this).ajaxSubmit({
- success:function(res){
-
- $(self).waitMe('hide');
-
- if(res.msg){
- new Noty({
- theme:'sunset',
- text: res.msg,
- type: 'success',
- timeout:1000,
- callbacks:{
- afterClose:function(){
- var replace_content=self.find('input[name=replace_content]').val();
-
- if(replace_content){
-
- url=self.find("input[name='replace_content']").data('replace');
-
- $(replace_content).waitMe({
- effect: 'facebook',
- text: 'Please! Wait ...'
- });
-
- $(replace_content).load(url, null, function(){
-
- $(replace_content).waitMe('hide');
-
- });
-
- $('#modal_page').modal('hide');
-
- }else window.location.reload();
-
- }
- }
- }).show();
- }
-
- },
- error:function(res){
-
- $(self).waitMe('hide');
-
- let msg="Request submission failed. Please! try again later.";
-
- if(res.responseJSON && res.responseJSON.msg){
- msg=res.responseJSON.msg;
- }
-
- new Noty({
- theme:'sunset',
- text: msg,
- type: 'error',
- timeout:3000,
- callbacks:{
- afterClose:function(){
- $('.btn-submit').prop('disabled', false);
- }
- }
- }).show();
-
- }
- });
-
- });
- });
- </script>
-
|