Ignore:
Timestamp:
06/04/12 16:56:48 (12 years ago)
Author:
acoutinho
Message:

Ticket #2834 - Inconsistência com lixo no javaScript

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/js/helpers.js

    r6393 r6412  
    371371        close: function(event, ui) { 
    372372            /** 
    373                                         * Remove tooltip possivelmente existente 
    374                                         */ 
     373                * Remove tooltip possivelmente existente 
     374                */ 
    375375            if ($('dd.attendee-list li:last').data('qtip')) 
    376376                $('dd.attendee-list li:last').qtip('destroy'); 
     
    392392                                canDiscardEventDialog = true; 
    393393                                /** 
    394                                                                                 *Remoção dos anexos do eventos caso seja cancelado a edição 
    395                                                                                 */ 
    396                                 var ids = []; 
     394                                *Remoção dos anexos do eventos caso seja cancelado a edição 
     395                                */ 
     396                                DataLayer.rollback(); 
     397 
     398                                var ids = false; 
    397399                                $.each($('.attachment-list input'), function (i, input) { 
    398                                     ids.push(input.value); 
     400                                    DataLayer.put('attachment', {id: ''+input.value}); 
     401                                    DataLayer.remove('attachment', ''+input.value); 
     402                                        ids = true; 
    399403                                }); 
    400                                 if(ids.length > 0) 
    401                                     DataLayer.remove('attachment', { 
    402                                         filter: ['IN', 'id', ids] 
    403                                         }); 
    404                                                                                  
    405                                 DataLayer.rollback(); 
     404                                if(ids) 
     405                                        DataLayer.commit(); 
     406                         
     407                                 
    406408                                                                                 
    407409                                UI.dialogs.addEvent.dialog('close'); 
     
    427429 
    428430            } 
     431            //DataLayer.rollback(); 
    429432            return canDiscardEventDialog; 
    430433        } 
     
    784787             
    785788.children(".cancel").click(function(){ 
    786     DataLayer.rollback('participant'); 
    787789    UI.dialogs.addEvent.dialog("close"); 
    788790}).end() 
Note: See TracChangeset for help on using the changeset viewer.